Files
jfaker/src
Trever Shick e1151d6cca Fix Number randomization quality and correctness (#136)
resolves DiUS/java-faker#121
fixes DiUS/java-faker#120

Number#numberBetween and Number#randomDouble exhibited poor behavior when using extremes for
their min/max values.  In the worst case, it would return the same number over and over and in
other cases (maybe this is the worst) it would die.  As a library used to generating fake data,
the library should do its best to not throw errors around min/max ranges, etc., instead
returning usable fake values that best fit the parameters passed in.

This PR fixes the issues with random number generation and a good number of tests were added
to ensure the quality of the randomization by ensuring that 90% of random series are 80% unique.
This should be sufficient for most uses.

Also, the Number class itself was refactored to reuse decimalBetween as the primary number generator
to ensure this randomization quality across all the random* number methods.
2016-10-18 09:48:36 +11:00
..