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

Alex Herbert commented on MATH-1668:
------------------------------------

The example case is using the nextLong(long, long) method. This is inherited 
from java.util.Random. So this bug may be in the JDK.

First try updating the code to use java.util.Random. Also let us know what JDK 
you are using.

Note that java.util.Random is not recommended. In JDK 8 you can use 
SplittableRandom and in JDK 17 there is a new random package with a cleaner and 
more flexible API.

Similar features to the JDK 17 random generators (stream support, more robust 
implementations) are available under JDK 8+ using the Commons RNG project.

Any bugs in the math 3 branch are unlikely to be fixed. New development is in 
the math 4 codebase. This has an alpha release available. You could try this or 
switch to using the RNG project.

 

 

> RandomDataGenerator produces the same result for different upper bounds
> -----------------------------------------------------------------------
>
>                 Key: MATH-1668
>                 URL: https://issues.apache.org/jira/browse/MATH-1668
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.6.1
>            Reporter: Arman Sharif
>            Priority: Major
>
> {{I noticed the RandomDataGenerator is producing the same result for 
> different upper bounds when the upper bound belongs to a certain range.}}
> I created a sample project with a test replicating the problem:
> [https://github.com/armandino/commons-math3-bug]
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to