Created
January 8, 2022 21:59
-
-
Save YShow/da678561419cda8e32fccf3a27a649d4 to your computer and use it in GitHub Desktop.
Test new wrapper for https://bugs.openjdk.java.net/browse/JDK-8279598
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jshell> import java.util.* | |
jshell> import java.util.random.* | |
jshell> import java.math.* | |
jshell> Random rand = RandomGenerator.getDefault().asRandom() | |
rand ==> jdk.internal.util.random.RandomWrapper@1963006a | |
jshell> List<Integer> intList = Arrays.asList(3,2,1,9,0,4,6,5) | |
intList ==> [3, 2, 1, 9, 0, 4, 6, 5] | |
jshell> Collections.shuffle(intList,rand) | |
jshell> intList.forEach(System.out::print) | |
16304952 | |
jshell> new BigInteger(32,rand) | |
$22 ==> 356275378 | |
jshell> new BigInteger(32,rand) | |
$23 ==> 674085345 | |
jshell> BigInteger.probablePrime(32,rand) | |
$24 ==> 2791255457 | |
jshell> BigInteger.probablePrime(32,rand) | |
$25 ==> 3318616813 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment