[ 
https://issues.apache.org/jira/browse/RNG-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17382089#comment-17382089
 ] 

Alex Herbert commented on RNG-140:
----------------------------------

bq. Which is the test that does that?

testSamplesWithFullRange : Tests the sampler just returns the same as 
nextLong().

testSamplesWithSmallNonPowerOf2Range : Tests the sampler returns the same as 
nextLong(long) using an implementation of o.a.c.rng.core.BaseProvider. That 
method is tested extensively as it is tested for all RNGs in the core package. 
If it is the same output then it random and uniform.

testSamplesWithPowerOf2Range : Tests the sampler with zero bits or all bits 
from the underlying RNG will output the lower and upper bound of the range.

testSamplesWithPowerOf2RangeIsBitShift : Tests the sampler uses the n most 
significant bits from nextLong() using a bit shift.

testSamplesWithLargeNonPowerOf2RangeIsRejectionMethod : Tests the sampler uses 
nextLong and discards samples outside the range.

If nextLong (or part of it for powers of 2) is uniform then the above tests 
will create uniform output.


> nextLong(long lo, long hi)
> --------------------------
>
>                 Key: RNG-140
>                 URL: https://issues.apache.org/jira/browse/RNG-140
>             Project: Commons RNG
>          Issue Type: Wish
>          Components: sampling
>            Reporter: Gilles Sadowski
>            Priority: Minor
>              Labels: api
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Replacement for functionality defined in 
> [{{RandomUtils}}|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/RandomUtils.java;h=60060e71d5bbe1d00878a1f54f8bb1ff88b65f11;hb=HEAD#l293].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to