/libcore/ojluni/src/test/java/lang/Math/ |
D | DivModTests.java | 90 static void testIntFloorDivMod(int x, int y, Object divExpected, Object modExpected) { in testIntFloorDivMod() argument 91 testIntFloorDiv(x, y, divExpected); in testIntFloorDivMod() 92 testIntFloorMod(x, y, modExpected); in testIntFloorDivMod() 98 static void testIntFloorDiv(int x, int y, Object expected) { in testIntFloorDiv() argument 99 Object result = doFloorDiv(x, y); in testIntFloorDiv() 101 fail("FAIL: Math.floorDiv(%d, %d) = %s; expected %s%n", x, y, result, expected); in testIntFloorDiv() 104 Object strict_result = doStrictFloorDiv(x, y); in testIntFloorDiv() 106 fail("FAIL: StrictMath.floorDiv(%d, %d) = %s; expected %s%n", x, y, strict_result, in testIntFloorDiv() 114 static void testIntFloorMod(int x, int y, Object expected) { in testIntFloorMod() argument 115 Object result = doFloorMod(x, y); in testIntFloorMod() [all …]
|
D | PowTests.java | 167 for (double y : testData) { in testCrossProduct() 172 if (Double.isNaN(y)) { in testCrossProduct() 174 } else if (y == 0.0) { in testCrossProduct() 176 } else if (Double.isInfinite(y)) { in testCrossProduct() 177 if (y > 0) { // x ^ (+oo) in testCrossProduct() 200 } else if (y == 1.0) { in testCrossProduct() 203 Assert.assertNotEquals(y, 0.0); in testCrossProduct() 206 expected = (y < 0.0) ? f2(y) : f1(y); in testCrossProduct() 208 expected = (y < 0.0) ? +0.0 : Double.POSITIVE_INFINITY; in testCrossProduct() 210 Assert.assertNotEquals(y, 0.0); in testCrossProduct() [all …]
|
D | ExactArithTests.java | 74 static void testIntegerExact(int x, int y) { in testIntegerExact() argument 77 int sum = Math.addExact(x, y); in testIntegerExact() 78 long sum2 = (long) x + (long) y; in testIntegerExact() 80 fail("FAIL: int Math.addExact(" + x + " + " + y + ") = " + sum in testIntegerExact() 83 fail("FAIL: long Math.addExact(" + x + " + " + y + ") = " + sum + "; expected: " in testIntegerExact() 87 long sum2 = (long) x + (long) y; in testIntegerExact() 89 fail("FAIL: int Math.addExact(" + x + " + " + y + ")" + "; Unexpected exception: " in testIntegerExact() 97 int diff = Math.subtractExact(x, y); in testIntegerExact() 98 long diff2 = (long) x - (long) y; in testIntegerExact() 100 fail("FAIL: int Math.subtractExact(" + x + " - " + y + ") = " + diff in testIntegerExact() [all …]
|
/libcore/luni/src/main/java/libcore/util/ |
D | FP16.java | 281 public static int compare(short x, short y) { in compare() argument 282 if (less(x, y)) return -1; in compare() 283 if (greater(x, y)) return 1; in compare() 289 short yBits = isNaN(y) ? NaN : y; in compare() 473 public static short min(short x, short y) { in min() argument 475 if (isNaN(y)) return NaN; in min() 477 if ((x & EXPONENT_SIGNIFICAND_MASK) == 0 && (y & EXPONENT_SIGNIFICAND_MASK) == 0) { in min() 478 return (x & SIGN_MASK) != 0 ? x : y; in min() 482 ((y & SIGN_MASK) != 0 ? 0x8000 - (y & 0xffff) : y & 0xffff) ? x : y; in min() 501 public static short max(short x, short y) { in max() argument [all …]
|
/libcore/ojluni/src/test/java/lang/StrictMath/ |
D | ExactArithTests.java | 72 static void testIntegerExact(int x, int y) { in testIntegerExact() argument 75 int sum = StrictMath.addExact(x, y); in testIntegerExact() 76 long sum2 = (long) x + (long) y; in testIntegerExact() 78 …fail("FAIL: int StrictMath.addExact(" + x + " + " + y + ") = " + sum + "; expected Arithmetic exce… in testIntegerExact() 80 … fail("FAIL: long StrictMath.addExact(" + x + " + " + y + ") = " + sum + "; expected: " + sum2); in testIntegerExact() 83 long sum2 = (long) x + (long) y; in testIntegerExact() 85 … fail("FAIL: int StrictMath.addExact(" + x + " + " + y + ")" + "; Unexpected exception: " + ex); in testIntegerExact() 91 int diff = StrictMath.subtractExact(x, y); in testIntegerExact() 92 long diff2 = (long) x - (long) y; in testIntegerExact() 94 …fail("FAIL: int StrictMath.subtractExact(" + x + " - " + y + ") = " + diff + "; expected: " + diff… in testIntegerExact() [all …]
|
D | FdlibmTranslit.java | 73 public static double hypot(double x, double y) { in hypot() argument 74 return Hypot.compute(x, y); in hypot() 162 public static double compute(double x, double y) { in compute() argument 164 double b = y; in compute() 169 hb = __HI(y) & 0x7fffffff; // high word of y in compute() 171 a = y; in compute() 178 b = y; in compute() 308 double y, hi = 0, lo = 0, c, t; in compute() local 361 y = ONE - ((lo - (x * c) / (2.0 - c)) - hi); in compute() 364 y = __HI(y, __HI(y) + (k << 20)); /* add k to y's exponent */ in compute() [all …]
|
D | MultiplicationTests.java | 61 private static long multiplyHighBigInt(long x, long y) { in multiplyHighBigInt() argument 62 return BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)) in multiplyHighBigInt() 67 private static boolean check(long x, long y) { in check() argument 68 long p1 = multiplyHighBigInt(x, y); in check() 69 long p2 = StrictMath.multiplyHigh(x, y); in check() 73 fail(String.format("Error - x:%d y:%d p1:%d p2:%d\n", x, y, p1, p2)); in check()
|
/libcore/ojluni/src/main/java/java/lang/ |
D | StrictMath.java | 556 public static native double atan2(double y, double x); in atan2() argument 786 public static int addExact(int x, int y) { in addExact() argument 787 return Math.addExact(x, y); in addExact() 801 public static long addExact(long x, long y) { in addExact() argument 802 return Math.addExact(x, y); in addExact() 816 public static int subtractExact(int x, int y) { in subtractExact() argument 817 return Math.subtractExact(x, y); in subtractExact() 831 public static long subtractExact(long x, long y) { in subtractExact() argument 832 return Math.subtractExact(x, y); in subtractExact() 846 public static int multiplyExact(int x, int y) { in multiplyExact() argument [all …]
|
D | Math.java | 695 public static native double atan2(double y, double x); in atan2() argument 1027 public static int addExact(int x, int y) { in addExact() argument 1028 int r = x + y; in addExact() 1030 if (((x ^ r) & (y ^ r)) < 0) { in addExact() 1047 public static long addExact(long x, long y) { in addExact() argument 1048 long r = x + y; in addExact() 1050 if (((x ^ r) & (y ^ r)) < 0) { in addExact() 1067 public static int subtractExact(int x, int y) { in subtractExact() argument 1068 int r = x - y; in subtractExact() 1071 if (((x ^ y) & (x ^ r)) < 0) { in subtractExact() [all …]
|
/libcore/ojluni/src/main/java/java/security/spec/ |
D | ECPoint.java | 42 private final BigInteger y; field in ECPoint 52 this.y = null; in ECPoint() 63 public ECPoint(BigInteger x, BigInteger y) { in ECPoint() argument 64 if ((x==null) || (y==null)) { in ECPoint() 68 this.y = y; in ECPoint() 86 return y; in getAffineY() 101 (y.equals(((ECPoint)obj).y))); in equals() 112 return x.hashCode() << 5 + y.hashCode(); in hashCode()
|
D | EdECPoint.java | 51 private final BigInteger y; field in EdECPoint 61 public EdECPoint(boolean xOdd, BigInteger y) { in EdECPoint() argument 63 Objects.requireNonNull(y, "y must not be null"); in EdECPoint() 66 this.y = y; in EdECPoint() 84 return y; in getY()
|
D | DSAPublicKeySpec.java | 47 private BigInteger y; field in DSAPublicKeySpec 63 public DSAPublicKeySpec(BigInteger y, BigInteger p, BigInteger q, in DSAPublicKeySpec() argument 65 this.y = y; in DSAPublicKeySpec() 77 return this.y; in getY()
|
/libcore/luni/src/test/java/libcore/java/util/function/ |
D | BiPredicateTest.java | 37 … (x, y) -> { alwaysTrueInvoked.set(true); assertSame(arg1, x); assertSame(arg2, y); return true; }; in testAnd() 39 …(x, y) -> { alwaysTrue2Invoked.set(true); assertSame(arg1, x); assertSame(arg2, y); return true; }; in testAnd() 41 …(x, y) -> { alwaysFalseInvoked.set(true); assertSame(arg1, x); assertSame(arg2, y); return false; … in testAnd() 43 …(x, y) -> { alwaysFalse2Invoked.set(true); assertSame(arg1, x); assertSame(arg2, y); return false;… in testAnd() 67 BiPredicate<Object, Object> alwaysTrue = (x, y) -> true; in testAnd_null() 78 (x, y) -> { assertSame(arg1, x); assertSame(arg2, y); return true; }; in testNegate() 82 (x, y) -> { assertSame(arg1, x); assertSame(arg2, y); return false; }; in testNegate() 97 … (x, y) -> { alwaysTrueInvoked.set(true); assertSame(arg1, x); assertSame(arg2, y); return true; }; in testOr() 99 …(x, y) -> { alwaysTrue2Invoked.set(true); assertSame(arg1, x); assertSame(arg2, y); return true; }; in testOr() 101 …(x, y) -> { alwaysFalseInvoked.set(true); assertSame(arg1, x); assertSame(arg2, y); return false; … in testOr() [all …]
|
/libcore/luni/src/main/native/ |
D | java_lang_StringToReal.cpp | 273 uint64_t* y; in doubleAlgorithm() local 278 x = y = D = D2 = 0; in doubleAlgorithm() 289 free(y); in doubleAlgorithm() 292 y = D = D2 = NULL; in doubleAlgorithm() 303 allocateU64 (y, yLength); in doubleAlgorithm() 304 memset (y + 1, 0, sizeof (uint64_t) * (yLength - 1)); in doubleAlgorithm() 305 *y = m; in doubleAlgorithm() 306 simpleShiftLeftHighPrecision (y, yLength, k); in doubleAlgorithm() 318 allocateU64 (y, 1); in doubleAlgorithm() 319 *y = m; in doubleAlgorithm() [all …]
|
/libcore/ojluni/src/main/java/sun/util/calendar/ |
D | CalendarUtils.java | 135 public static final long mod(long x, long y) { in mod() argument 136 return (x - y * floorDivide(x, y)); in mod() 139 public static final int mod(int x, int y) { in mod() argument 140 return (x - y * floorDivide(x, y)); in mod() 143 public static final int amod(int x, int y) { in amod() argument 144 int z = mod(x, y); in amod() 145 return (z == 0) ? y : z; in amod() 148 public static final long amod(long x, long y) { in amod() argument 149 long z = mod(x, y); in amod() 150 return (z == 0) ? y : z; in amod()
|
/libcore/ojluni/src/test/java/lang/invoke/ |
D | PermuteArgsTest.java | 62 static Object list2I(int x, int y) { in list2I() argument 63 return Arrays.asList(x, y); in list2I() 65 static Object list3I(int x, int y, int z) { in list3I() argument 66 return Arrays.asList(x, y, z); in list3I() 68 static Object list4I(int w, int x, int y, int z) { in list4I() argument 69 return Arrays.asList(w, x, y, z); in list4I() 71 static Object list2J(long x, long y) { in list2J() argument 72 return Arrays.asList(x, y); in list2J() 74 static Object list3J(long x, long y, long z) { in list3J() argument 75 return Arrays.asList(x, y, z); in list3J() [all …]
|
D | MethodHandlesTest.java | 430 public Object v2(Object x, Object y) { return called("v2", this, x, y); } in v2() argument 431 public Object v2(Object x, int y) { return called("v2", this, x, y); } in v2() argument 432 public Object v2(int x, Object y) { return called("v2", this, x, y); } in v2() argument 433 public Object v2(int x, int y) { return called("v2", this, x, y); } in v2() argument 437 public static Object s4(int x, int y) { return called("s4", x, y); } in s4() argument 438 public static Object s5(long x, int y) { return called("s5", x, y); } in s5() argument 439 public static Object s6(int x, long y) { return called("s6", x, y); } in s6() argument 440 public static Object s7(float x, double y) { return called("s7", x, y); } in s7() argument 443 public Example(String x, int y) { this.name = x+y; called("Example.<init>", x, y); } in Example() argument 444 public Example(int x, String y) { this.name = x+y; called("Example.<init>", x, y); } in Example() argument [all …]
|
/libcore/ojluni/src/test/java/io/Serializable/records/ |
D | ReadResolveTest.java | 53 private final int y; field in ReadResolveTest.C1 54 C1(int x, int y) { this.x = x; this.y = y; } in C1() argument 55 private record SerProxy1(int x, int y) implements Serializable { 57 private Object readResolve() { return new C1(x, y); } in readResolve() 61 return new SerProxy1(x, y); in writeReplace() 65 return obj != null && obj instanceof C1 && ((C1)obj).x == this.x && ((C1)obj).y == y; in equals() 68 public String toString() { return format("C1[x=%x, y=%d]", x, y); } in toString() 88 record R1 (int x, int y, String s) implements Serializable { 95 return new SerProxy3(x, y, s); in writeReplace()
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | BigIntegerBenchmark.java | 26 BigInteger y = new BigInteger(1024, r); in timeRandomDivision() local 28 x.divide(y); in timeRandomDivision() 35 BigInteger y = new BigInteger(1024, r); in timeRandomGcd() local 37 x.gcd(y); in timeRandomGcd() 44 BigInteger y = new BigInteger(1024, r); in timeRandomMultiplication() local 46 x.multiply(y); in timeRandomMultiplication()
|
/libcore/ojluni/src/main/java/javax/crypto/spec/ |
D | DHPublicKeySpec.java | 46 private BigInteger y; field in DHPublicKeySpec 61 public DHPublicKeySpec(BigInteger y, BigInteger p, BigInteger g) { in DHPublicKeySpec() argument 62 this.y = y; in DHPublicKeySpec() 73 return this.y; in getY()
|
/libcore/ojluni/src/test/java/math/BigInteger/ |
D | BigIntegerTest.java | 218 BigInteger y = x.pow(power); in pow() local 224 Assert.assertEquals(y, z); in pow() 352 BigInteger y = fetchNumber(order/2); in arithmetic() local 353 while(x.compareTo(y) == -1) in arithmetic() 354 y = fetchNumber(order/2); in arithmetic() 355 if (y.equals(BigInteger.ZERO)) in arithmetic() 356 y = y.add(BigInteger.ONE); in arithmetic() 360 BigInteger baz = x.divide(y); in arithmetic() 361 baz = baz.multiply(y); in arithmetic() 362 baz = baz.add(x.remainder(y)); in arithmetic() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | ArraysTest.java | 282 Arrays.parallelPrefix(list, (x, y) -> x + y); in parallelPrefix$I() 292 Arrays.parallelPrefix((int[]) null, (x, y) -> x + y); in parallelPrefix$I() 318 Arrays.parallelPrefix(list, begin, end, (x, y) -> x + y); in parallelPrefix$III() 328 Arrays.parallelPrefix((int[]) null, begin, end, (x, y) -> x + y); in parallelPrefix$III() 334 Arrays.parallelPrefix(list, end, begin, (x, y) -> x + y); in parallelPrefix$III() 359 Arrays.parallelPrefix(list, (x, y) -> x + y); in parallelPrefix$L() 369 Arrays.parallelPrefix((long[]) null, (x, y) -> x + y); in parallelPrefix$L() 395 Arrays.parallelPrefix(list, begin, end, (x, y) -> x + y); in parallelPrefix$LII() 405 Arrays.parallelPrefix((long[]) null, begin, end, (x, y) -> x + y); in parallelPrefix$LII() 411 Arrays.parallelPrefix(list, end, begin, (x, y) -> x + y); in parallelPrefix$LII() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | ByteTest.java | 65 final byte y = -2; // 254 in testCompareUnsigned() 69 assertTrue(Byte.compareUnsigned(a, y) < 0); in testCompareUnsigned() 71 assertTrue(Byte.compareUnsigned(b, y) < 0); in testCompareUnsigned() 73 assertTrue(Byte.compareUnsigned(y, z) < 0); in testCompareUnsigned() 76 assertTrue(Byte.compareUnsigned(y, a) > 0); in testCompareUnsigned() 77 assertTrue(Byte.compareUnsigned(y, b) > 0); in testCompareUnsigned() 80 assertTrue(Byte.compareUnsigned(z, y) > 0); in testCompareUnsigned() 84 assertTrue(Byte.compareUnsigned(y, y) == 0); in testCompareUnsigned()
|
D | ShortTest.java | 65 final short y = -2; // 65534 in testCompareUnsigned() local 69 assertTrue(Short.compareUnsigned(a, y) < 0); in testCompareUnsigned() 71 assertTrue(Short.compareUnsigned(b, y) < 0); in testCompareUnsigned() 73 assertTrue(Short.compareUnsigned(y, z) < 0); in testCompareUnsigned() 76 assertTrue(Short.compareUnsigned(y, a) > 0); in testCompareUnsigned() 77 assertTrue(Short.compareUnsigned(y, b) > 0); in testCompareUnsigned() 80 assertTrue(Short.compareUnsigned(z, y) > 0); in testCompareUnsigned() 84 assertTrue(Short.compareUnsigned(y, y) == 0); in testCompareUnsigned()
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | ConcurrentHashMap8Test.java | 120 map.computeIfPresent(six, (x, y) -> "Z"); in testComputeIfPresent() 129 assertEquals("Z", map.computeIfPresent(one, (x, y) -> "Z")); in testComputeIfPresent2() 137 map.compute(six, (x, y) -> null); in testCompute() 146 assertEquals("Z", map.compute(six, (x, y) -> "Z")); in testCompute2() 154 assertEquals("Z", map.compute(one, (x, y) -> "Z")); in testCompute3() 162 map.compute(one, (x, y) -> null); in testCompute4() 171 assertEquals("Y", map.merge(six, "Y", (x, y) -> "Z")); in testMerge1() 179 assertEquals("Z", map.merge(one, "Y", (x, y) -> "Z")); in testMerge2() 187 map.merge(one, "Y", (x, y) -> null); in testMerge3() 216 map.replaceAll((x, y) -> { return x > 3 ? "Z" : y; }); in testReplaceAll() argument [all …]
|