question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Units dropped from random() $limit

See original GitHub issue

Deprecation

Final


(Original:)

The unit passed with the limit should be the unit on the returned value. Instead the unit is dropped and never considered nor is an error raised.

Step 1: Deprecate passing units to random() as the $limit.

Step 2: Make passing a unit to random() as the $limit an error.

Step 3: Allow units to be passed in, returning them with the random result.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nex3commented, Jun 16, 2022

@jcutrell No, the desire is to (ultimately) have math.random(10px) return a number with the unit px.

0reactions
Goodwinecommented, Aug 18, 2022

Deprecation added, now waiting on Dart 2.0.0 to implement spec

Read more comments on GitHub >

github_iconTop Results From Across the Web

Central limit theorem - Wikipedia
In probability theory, the central limit theorem (CLT) establishes that, in many situations, when independent random variables are summed up, their properly ...
Read more >
How to Do Random Allocation (Randomization) - PMC - NCBI
We explain the general concept of random allocation and demonstrate how to perform the procedure easily and how to report it in a...
Read more >
How can I generate a random number within a range but ...
@Pete looks like you're right. The max value for Math.random() is something less than 1. I have looked high and low, and the...
Read more >
The Central Limit Theorem for Sample Means (Averages)
Central Limit Theorem. Suppose X is a random variable with a distribution that may be known or unknown (it can be any distribution)....
Read more >
A Gentle Introduction to Dropout for Regularizing Deep Neural ...
Problem With Overfitting; Randomly Drop Nodes; How to Dropout ... By dropping a unit out, we mean temporarily removing it from the network, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found