Home
last modified time | relevance | path

Searched refs:rand (Results 1 – 24 of 24) sorted by relevance

/libcore/luni/src/test/java/libcore/java/util/
DRandomTest.java70 Random rand = new Random(0); in test_ints$() local
73 rands[i] = rand.nextInt(); in test_ints$()
84 Random rand = new Random(0); in test_ints$L() local
87 rands[i] = rand.nextInt(); in test_ints$L()
106 Random rand = new Random(0); in test_ints$II() local
109 rands[i] = rand.nextInt(bound - origin) + origin; in test_ints$II()
127 Random rand = new Random(0); in test_ints$LII() local
130 rands[i] = rand.nextInt(bound - origin) + origin; in test_ints$LII()
151 Random rand = new Random(0); in test_longs$() local
154 rands[i] = rand.nextLong(); in test_longs$()
[all …]
DArraysTest.java275 Random rand = new Random(0); in parallelPrefix$I() local
278 list[i] = rand.nextInt() % 1000; // Prevent overflow in parallelPrefix$I()
310 Random rand = new Random(0); in parallelPrefix$III() local
313 list[i] = rand.nextInt() % 1000; // Prevent overflow in parallelPrefix$III()
352 Random rand = new Random(0); in parallelPrefix$L() local
355 list[i] = rand.nextLong() % 1000000; // Prevent overflow in parallelPrefix$L()
387 Random rand = new Random(0); in parallelPrefix$LII() local
390 list[i] = rand.nextLong() % 1000000; // Prevent overflow in parallelPrefix$LII()
429 Random rand = new Random(0); in parallelPrefix$D() local
432 list[i] = rand.nextDouble() * 1000; in parallelPrefix$D()
[all …]
/libcore/ojluni/src/test/java/nio/channels/Channels/
DBasic2.java40 static final Random rand = new Random(); field in Basic2
96 byte[] buf = new byte[128 + rand.nextInt(128)]; in run()
98 if (rand.nextBoolean()) { in run()
103 len = 1 + rand.nextInt(64); in run()
104 off = rand.nextInt(64); in run()
135 this.total = 50*1000 + rand.nextInt(50*1000); in Writer()
143 byte[] buf = new byte[1 + rand.nextInt(rem)]; in run()
147 if (rand.nextBoolean()) { in run()
151 off = rand.nextInt(buf.length); in run()
153 len = (r <= 1) ? 1 : (1 + rand.nextInt(r)); in run()
[all …]
DShortWrite.java41 static Random rand = new Random(); field in ShortWrite
52 int n = rand.nextInt(rem) + 1; in testShortWrite()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DOldBigIntegerTest.java31 Random rand = new Random(); field in OldBigIntegerTest
50 bi = new BigInteger(70, rand); in test_ConstructorILjava_util_Random()
51 bi2 = new BigInteger(70, rand); in test_ConstructorILjava_util_Random()
57 assertTrue("Not zero", new BigInteger(0, rand).equals(BigInteger.ZERO)); in test_ConstructorILjava_util_Random()
72 BigInteger bi1 = new BigInteger(10, 5, rand); in test_ConstructorIILjava_util_Random()
73 BigInteger bi2 = new BigInteger(10, 5, rand); in test_ConstructorIILjava_util_Random()
79 Random rand = new Random(); in test_ConstructorIILjava_util_Random() local
85 bi = new BigInteger(i, c, rand); // Create BigInteger in test_ConstructorIILjava_util_Random()
125 bi = new BigInteger(20, 20, rand); in test_isProbablePrimeI()
147 bi = BigInteger.valueOf(rand.nextInt(1000000)).multiply( in test_isProbablePrimeI()
[all …]
DBigIntegerTest.java48 Random rand = new Random(); field in BigIntegerTest
87 bi = new BigInteger(70, rand); in test_ConstructorILjava_util_Random()
88 bi2 = new BigInteger(70, rand); in test_ConstructorILjava_util_Random()
95 assertTrue("Not zero", new BigInteger(0, rand).equals(BigInteger.ZERO)); in test_ConstructorILjava_util_Random()
168 bi = new BigInteger(20, 20, rand); in test_isProbablePrimeI()
190 bi = BigInteger.valueOf(rand.nextInt(1000000)).multiply( in test_isProbablePrimeI()
191 BigInteger.valueOf(rand.nextInt(1000000))); in test_isProbablePrimeI()
198 bi = new BigInteger(70, rand).multiply(new BigInteger(70, rand)); in test_isProbablePrimeI()
/libcore/ojluni/src/test/java/util/DoubleStreamSums/
DCompensatedSums.java66 double[] rand = r.doubles(1_000_000) in testCompensatedSums() local
73 for (int i=0; i < rand.length; i++) { in testCompensatedSums()
74 sumWithCompensation(sum, rand[i]); in testCompensatedSums()
81 naive += square(DoubleStream.of(rand).reduce((x, y) -> x+y).getAsDouble() - sum[0]); in testCompensatedSums()
84 jdkSequentialStreamError += square(DoubleStream.of(rand).sum() - sum[0]); in testCompensatedSums()
86 …goodSequentialStreamError += square(computeFinalSum(DoubleStream.of(rand).collect(doubleSupplier,o… in testCompensatedSums()
89 jdkParallelStreamError += square(DoubleStream.of(rand).parallel().sum() - sum[0]); in testCompensatedSums()
92 …goodParallelStreamError += square(computeFinalSum(DoubleStream.of(rand).parallel().collect(doubleS… in testCompensatedSums()
95 …badParallelStreamError += square(computeFinalSum(DoubleStream.of(rand).parallel().collect(doubleSu… in testCompensatedSums()
/libcore/luni/src/test/java/libcore/java/math/
DBigIntegerTest.java89 Random rand = new Random(); in test_Constructor_ILjava_util_Random() local
92 b = new BigInteger(128, rand); in test_Constructor_ILjava_util_Random()
95 b = new BigInteger(16, rand); in test_Constructor_ILjava_util_Random()
98 b = new BigInteger(5, rand); in test_Constructor_ILjava_util_Random()
104 Random rand = new Random(); in test_Constructor_IILjava_util_Random() local
107 b = new BigInteger(128, 100, rand); in test_Constructor_IILjava_util_Random()
111 b = new BigInteger(16, 100, rand); in test_Constructor_IILjava_util_Random()
115 b = new BigInteger(5, 100, rand); in test_Constructor_IILjava_util_Random()
125 b = new BigInteger(2, 100, rand); in test_Constructor_IILjava_util_Random()
143 Random rand = new Random(); in test_probablePrime() local
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DRandomTest.java309 Random rand = new Random(0x8123aea6267e055dL); in testSerializationCompatibility() local
310 rand.nextGaussian(); in testSerializationCompatibility()
312 SerializationTest.verifyGolden(this, rand, comparator); in testSerializationCompatibility()
314 rand = new Random(0x8123aea6267e055dL); in testSerializationCompatibility()
315 rand.nextGaussian(); in testSerializationCompatibility()
316 SerializationTest.verifySelf(rand, comparator); in testSerializationCompatibility()
/libcore/tools/go/certutil/
Dcertutil.go42 key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
100 rand.Reader,
142 r, err := rand.Int(rand.Reader, max)
/libcore/ojluni/src/test/java/text/Format/MessageFormat/
DBug7003643.java44 Random rand = new Random(); in main() local
52 sb.append(elements[rand.nextInt(elements.length)]); in main()
/libcore/ojluni/src/test/java/lang/Math/
DCubeRootTests.java50 static java.util.Random rand = new Random(); field in CubeRootTests
128 ((long) (rand.nextInt() & 0xFFFF)) << in testCubeRoot()
135 ((long) (rand.nextInt() & 0xFFFF)) << in testCubeRoot()
176 double d = 1.0 + rand.nextDouble(); in testCubeRoot()
DLog1pTests.java114 java.util.Random rand = new Random(); in testLog1p() local
116 double d = rand.nextDouble(); in testLog1p()
DLog10Tests.java45 static java.util.Random rand = new java.util.Random(0L); field in Log10Tests
97 double input = Double.longBitsToDouble(rand.nextLong()); in testLog10()
DHypotTests.java130 java.util.Random rand = new Random(); in testHypot() local
134 double d = rand.nextDouble(); in testHypot()
DIeeeRecommendedTests.java61 static java.util.Random rand = new Random(); field in IeeeRecommendedTests
168 int randSignif = rand.nextInt(); in testFloatGetExponent()
217 (rand.nextInt() & mask)); in testFloatGetExponent()
265 long randSignif = rand.nextLong(); in testDoubleGetExponent()
317 (rand.nextLong() & mask)); in testDoubleGetExponent()
1345 int randSignif = rand.nextInt(); in testFloatUlp()
1396 (rand.nextInt() & mask)); in testFloatUlp()
1448 long randSignif = rand.nextLong(); in testDoubleUlp()
1499 (rand.nextLong() & mask)); in testDoubleUlp()
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadLocalRandomTest.java358 final AtomicLong rand = new AtomicLong();
369 rand.set(current.nextLong());
375 firstRand = rand.get();
381 if (firstRand != rand.get())
/libcore/ojluni/src/test/java/util/concurrent/tck/
DThreadLocalRandomTest.java384 final AtomicLong rand = new AtomicLong();
395 rand.set(current.nextLong());
401 firstRand = rand.get();
407 if (firstRand != rand.get())
/libcore/ojluni/src/test/java/lang/Double/
DToHexStringTest.java229 java.util.Random rand = new java.util.Random(0); in testRandomDoubles() local
231 double d = rand.nextDouble(); in testRandomDoubles()
DParseHexFloatingPointTest.java253 java.util.Random rand = new Random(); in testRandomDoubles() local
257 double d = rand.nextDouble(); in testRandomDoubles()
/libcore/ojluni/src/test/java/util/zip/
DCloseInflaterDeflaterTest.java77 private static Random rand = new Random(); field in CloseInflaterDeflaterTest
111 rand.nextBytes(inputBytes); in before_test()
/libcore/ojluni/src/test/java/nio/file/attribute/
DFileTimeTest.java44 static final Random rand = new Random(); field in FileTimeTest
117 for (int i=0; i<100; i++) { to(rand.nextLong(), unit); } in main()
126 long value = rand.nextLong(); in main()
156 long v = rand.nextLong(); in main()
158 Instant instant = Instant.ofEpochSecond(secs, rand.nextInt(1000_000_000)); in main()
/libcore/ojluni/src/test/java/lang/StackWalker/
DStackWalkTest.java276 String rand = "-random"; in main() local
279 if (arg.startsWith(rand)) { in main()
/libcore/support/src/test/java/tests/resources/x509/
Ddefault.cnf95 RANDFILE = $dir/private/.rand # private random number file