/libcore/ojluni/src/test/java/lang/Math/ |
D | DivModTests.java | 115 static void testIntFloorDivMod(int x, int y, Object divExpected, Object modExpected) { in testIntFloorDivMod() argument 116 testIntFloorDiv(x, y, divExpected); in testIntFloorDivMod() 117 testIntFloorMod(x, y, modExpected); in testIntFloorDivMod() 123 static void testIntFloorDiv(int x, int y, Object expected) { in testIntFloorDiv() argument 124 Object result = doFloorDiv(x, y); in testIntFloorDiv() 126 fail("FAIL: Math.floorDiv(%d, %d) = %s; expected %s%n", x, y, result, expected); in testIntFloorDiv() 129 Object strict_result = doStrictFloorDiv(x, y); in testIntFloorDiv() 131 … fail("FAIL: StrictMath.floorDiv(%d, %d) = %s; expected %s%n", x, y, strict_result, expected); in testIntFloorDiv() 138 static void testIntFloorMod(int x, int y, Object expected) { in testIntFloorMod() argument 139 Object result = doFloorMod(x, y); in testIntFloorMod() [all …]
|
D | ExactArithTests.java | 99 static void testIntegerExact(int x, int y) { in testIntegerExact() argument 102 int sum = Math.addExact(x, y); in testIntegerExact() 103 long sum2 = (long) x + (long) y; in testIntegerExact() 105 …fail("FAIL: int Math.addExact(" + x + " + " + y + ") = " + sum + "; expected Arithmetic exception"… in testIntegerExact() 107 … fail("FAIL: long Math.addExact(" + x + " + " + y + ") = " + sum + "; expected: " + sum2); in testIntegerExact() 110 long sum2 = (long) x + (long) y; in testIntegerExact() 112 … fail("FAIL: int Math.addExact(" + x + " + " + y + ")" + "; Unexpected exception: " + ex); in testIntegerExact() 118 int diff = Math.subtractExact(x, y); in testIntegerExact() 119 long diff2 = (long) x - (long) y; in testIntegerExact() 121 … fail("FAIL: int Math.subtractExact(" + x + " - " + y + ") = " + diff + "; expected: " + diff2); in testIntegerExact() [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 | MultiplicationTests.java | 51 private static long multiplyHighBigInt(long x, long y) { in multiplyHighBigInt() argument 52 return BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)) in multiplyHighBigInt() 57 private static long unsignedMultiplyHigh(long x, long y) { in unsignedMultiplyHigh() argument 60 long y0 = y & 0xffffffffL; in unsignedMultiplyHigh() 61 long y1 = y >>> 32; in unsignedMultiplyHigh() 72 BiFunction<Long,Long,Long> multiply, long x, long y) { in check() argument 73 long p1 = reference.apply(x, y); in check() 74 long p2 = multiply.apply(x, y); in check() 76 System.err.printf("Error - x:%d y:%d p1:%d p2:%d\n", x, y, p1, p2); in check() 84 private static boolean checkSigned(long x, long y) { in checkSigned() argument [all …]
|
/libcore/ojluni/src/main/java/java/lang/ |
D | StrictMath.java | 631 public static native double atan2(double y, double x); in atan2() argument 861 public static int addExact(int x, int y) { in addExact() argument 862 return Math.addExact(x, y); in addExact() 876 public static long addExact(long x, long y) { in addExact() argument 877 return Math.addExact(x, y); in addExact() 891 public static int subtractExact(int x, int y) { in subtractExact() argument 892 return Math.subtractExact(x, y); in subtractExact() 906 public static long subtractExact(long x, long y) { in subtractExact() argument 907 return Math.subtractExact(x, y); in subtractExact() 921 public static int multiplyExact(int x, int y) { in multiplyExact() argument [all …]
|
D | Math.java | 721 public static native double atan2(double y, double x); in atan2() argument 1055 public static int addExact(int x, int y) { in addExact() argument 1056 int r = x + y; in addExact() 1058 if (((x ^ r) & (y ^ r)) < 0) { in addExact() 1075 public static long addExact(long x, long y) { in addExact() argument 1076 long r = x + y; in addExact() 1078 if (((x ^ r) & (y ^ r)) < 0) { in addExact() 1095 public static int subtractExact(int x, int y) { in subtractExact() argument 1096 int r = x - y; in subtractExact() 1099 if (((x ^ y) & (x ^ r)) < 0) { in subtractExact() [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/annotations/flagged_api/java/lang/ |
D | StrictMath.annotated.java | 68 public static native double atan2(double y, double x); in atan2() argument 78 public static int addExact(int x, int y) { throw new RuntimeException("Stub!"); } in addExact() argument 80 public static long addExact(long x, long y) { throw new RuntimeException("Stub!"); } in addExact() argument 82 public static int subtractExact(int x, int y) { throw new RuntimeException("Stub!"); } in subtractExact() argument 84 public static long subtractExact(long x, long y) { throw new RuntimeException("Stub!"); } in subtractExact() argument 86 public static int multiplyExact(int x, int y) { throw new RuntimeException("Stub!"); } in multiplyExact() argument 88 public static long multiplyExact(long x, int y) { throw new RuntimeException("Stub!"); } in multiplyExact() argument 90 public static long multiplyExact(long x, long y) { throw new RuntimeException("Stub!"); } in multiplyExact() argument 93 public static int divideExact(int x, int y) { throw new RuntimeException("Stub!"); } in divideExact() argument 96 public static long divideExact(long x, long y) { throw new RuntimeException("Stub!"); } in divideExact() argument [all …]
|
D | Math.annotated.java | 69 public static native double atan2(double y, double x); in atan2() argument 79 public static int addExact(int x, int y) { throw new RuntimeException("Stub!"); } in addExact() argument 81 public static long addExact(long x, long y) { throw new RuntimeException("Stub!"); } in addExact() argument 83 public static int subtractExact(int x, int y) { throw new RuntimeException("Stub!"); } in subtractExact() argument 85 public static long subtractExact(long x, long y) { throw new RuntimeException("Stub!"); } in subtractExact() argument 87 public static int multiplyExact(int x, int y) { throw new RuntimeException("Stub!"); } in multiplyExact() argument 89 public static long multiplyExact(long x, int y) { throw new RuntimeException("Stub!"); } in multiplyExact() argument 91 public static long multiplyExact(long x, long y) { throw new RuntimeException("Stub!"); } in multiplyExact() argument 94 public static int divideExact(int x, int y) { throw new RuntimeException("Stub!"); } in divideExact() argument 97 public static long divideExact(long x, long y) { throw new RuntimeException("Stub!"); } in divideExact() argument [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() 102 && (y.equals(other.y))); in equals() 111 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/ojluni/src/test/java/util/Collections/ |
D | RacingCollections.java | 240 public int compare(Integer x, Integer y) { in maps() 241 return x - y; in maps() 304 private static void describe(Class<?> k, Object x, Object y) { in describe() argument 308 y.getClass().getSimpleName()); in describe() 313 for (Map<Integer, Boolean> y : newConcurrentMaps()) { in realMain() 314 describe(Map.class, x, y); in realMain() 316 frob(x, y); in realMain() 317 frob(unmodifiableMap(x), y); in realMain() local 318 frob(synchronizedMap(x), y); in realMain() local 319 frob(x, synchronizedMap(y)); in realMain() [all …]
|
/libcore/ojluni/src/test/java/math/BigInteger/ |
D | LargeValueExceptions.java | 73 BigInteger y = x.multiply(x); in squareNoOverflow() local 80 BigInteger y = x.multiply(x); in squareIndefiniteOverflowSuccess() local 87 BigInteger y = x.multiply(x); in squareIndefiniteOverflowFailure() local 97 BigInteger y = x.multiply(x); in squareDefiniteOverflow() local 108 BigInteger y = ONE.shiftLeft(halfMaxBits - 1).subtract(ONE); in multiplyNoOverflow() local 109 BigInteger z = x.multiply(y); in multiplyNoOverflow() 118 BigInteger y = ONE.shiftLeft((int)(MAX_BITS/2) - 1); in multiplyIndefiniteOverflowSuccess() local 119 long n = MAX_BITS - y.bitLength(); in multiplyIndefiniteOverflowSuccess() 125 BigInteger z = x.multiply(y); in multiplyIndefiniteOverflowSuccess() 134 BigInteger y = ONE.shiftLeft((int)(MAX_BITS/2)).subtract(ONE); in multiplyIndefiniteOverflowFailure() local [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 …]
|
/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/ojluni/src/test/java/util/Arrays/ |
D | Correct.java | 89 for (int y=x + 1; y<to; y++) { in stupidSort() 90 if (((Comparable)a1[y]).compareTo((Comparable)lowest) < 0) { in stupidSort() 91 lowest = a1[y]; in stupidSort() 92 lowestIndex = y; in stupidSort() 108 for (int y=x + 1; y<to; y++) { in stupidSort() 109 if (comparator.compare(a1[y], lowest) < 0) { in stupidSort() 110 lowest = a1[y]; in stupidSort() 111 lowestIndex = y; in stupidSort()
|
/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()
|