Provide range-based numeric generators
See original GitHub issueAs discussed in #214, it would be useful for certain applications to provide a configurable range-based Double generator. Since the default Double
generator is, by design, unable to compare two Double
values as a consequence of the JVM specification, it would be nice to have a generator implementation which does not consider such extrema. Furthermore, since this behavior extends to other floating point types per the IEEE standard, it would be nice to circumvent these cases for the purposes of checking other numerical properties.
Further motivation for range-based generators would be to cover the space input values more extensively, for a smaller subset of the input domain.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Random Number Generator - Calculator Soup
Random number generator for numbers 0 to 10000. Generate positive or negative pseudo-random numbers in your custom min-max range with repeats or no...
Read more >Regex Numeric Range Generator — Regex Tools — 3Widgets
Generate regular expressions for numeric ranges. Just enter start and end of the range and get a valid regex. Works for both positive...
Read more >Efficiently Generating a Number in a Range - pcg-random.org
Most modern good-quality random number generators produce machine words filled with random bits, thus typically generating numbers in the ...
Read more >How to generate random number in given range using ...
Method 1: Using Math.random() function: The Math.random() function is used to return a floating-point pseudo-random number between range [0 ...
Read more >Random Number Generator - Calculator.net
Two free random number generators that work in user-defined min and max range. Both random integers and decimal numbers can be generated with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This wouldn’t be hard to implement, we just have to figure out some nomenclature. I was thinking something like this:
Gen.double()
as it is (generating all possible doubles)Gen.numericDoubles()
which would generate only numeric doubles (including a very very small one, close to -Infinity and a very very big one, close to +Infinity)Gen.numericDoubles(minValue, maxValue)
which would generate only numeric doubles, in the interval [minValue, maxValue]exactDoubles, representableDoubles, numericDoubles
On Tue, 8 Jan 2019 at 12:53, Kerooker notifications@github.com wrote: