Home
last modified time | relevance | path

Searched refs:y (Results 1 – 25 of 202) sorted by relevance

123456789

/libcore/ojluni/src/test/java/lang/Math/
DDivModTests.java88 static void testIntFloorDivMod(int x, int y, Object divExpected, Object modExpected) { in testIntFloorDivMod() argument
89 testIntFloorDiv(x, y, divExpected); in testIntFloorDivMod()
90 testIntFloorMod(x, y, modExpected); in testIntFloorDivMod()
96 static void testIntFloorDiv(int x, int y, Object expected) { in testIntFloorDiv() argument
97 Object result = doFloorDiv(x, y); in testIntFloorDiv()
99 fail("FAIL: Math.floorDiv(%d, %d) = %s; expected %s%n", x, y, result, expected); in testIntFloorDiv()
102 Object strict_result = doStrictFloorDiv(x, y); in testIntFloorDiv()
104 … fail("FAIL: StrictMath.floorDiv(%d, %d) = %s; expected %s%n", x, y, strict_result, expected); in testIntFloorDiv()
111 static void testIntFloorMod(int x, int y, Object expected) { in testIntFloorMod() argument
112 Object result = doFloorMod(x, y); in testIntFloorMod()
[all …]
DExactArithTests.java75 static void testIntegerExact(int x, int y) { in testIntegerExact() argument
78 int sum = Math.addExact(x, y); in testIntegerExact()
79 long sum2 = (long) x + (long) y; in testIntegerExact()
81 …fail("FAIL: int Math.addExact(" + x + " + " + y + ") = " + sum + "; expected Arithmetic exception"… in testIntegerExact()
83 … fail("FAIL: long Math.addExact(" + x + " + " + y + ") = " + sum + "; expected: " + sum2); in testIntegerExact()
86 long sum2 = (long) x + (long) y; in testIntegerExact()
88 … fail("FAIL: int Math.addExact(" + x + " + " + y + ")" + "; Unexpected exception: " + ex); in testIntegerExact()
95 int diff = Math.subtractExact(x, y); in testIntegerExact()
96 long diff2 = (long) x - (long) y; in testIntegerExact()
98 … fail("FAIL: int Math.subtractExact(" + x + " - " + y + ") = " + diff + "; expected: " + diff2); in testIntegerExact()
[all …]
DMultiplicationTests.java35 private static long multiplyHighBigInt(long x, long y) { in multiplyHighBigInt() argument
36 return BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)) in multiplyHighBigInt()
64 long y = xy[1]; in testMultiplyHigh() local
65 long p1 = multiplyHighBigInt(x, y); in testMultiplyHigh()
66 long p2 = Math.multiplyHigh(x, y); in testMultiplyHigh()
/libcore/ojluni/src/test/java/lang/StrictMath/
DExactArithTests.java99 static void testIntegerExact(int x, int y) { in testIntegerExact() argument
102 int sum = StrictMath.addExact(x, y); in testIntegerExact()
103 long sum2 = (long) x + (long) y; in testIntegerExact()
105 …fail("FAIL: int StrictMath.addExact(" + x + " + " + y + ") = " + sum + "; expected Arithmetic exce… in testIntegerExact()
107 … fail("FAIL: long StrictMath.addExact(" + x + " + " + y + ") = " + sum + "; expected: " + sum2); in testIntegerExact()
110 long sum2 = (long) x + (long) y; in testIntegerExact()
112 … fail("FAIL: int StrictMath.addExact(" + x + " + " + y + ")" + "; Unexpected exception: " + ex); in testIntegerExact()
119 int diff = StrictMath.subtractExact(x, y); in testIntegerExact()
120 long diff2 = (long) x - (long) y; in testIntegerExact()
122 …fail("FAIL: int StrictMath.subtractExact(" + x + " - " + y + ") = " + diff + "; expected: " + diff… in testIntegerExact()
[all …]
DMultiplicationTests.java58 private static long multiplyHighBigInt(long x, long y) { in multiplyHighBigInt() argument
59 return BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)) in multiplyHighBigInt()
64 private static boolean check(long x, long y) { in check() argument
65 long p1 = multiplyHighBigInt(x, y); in check()
66 long p2 = StrictMath.multiplyHigh(x, y); in check()
70 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/
DStrictMath.java523 public static native double atan2(double y, double x); in atan2() argument
737 public static int addExact(int x, int y) { in addExact() argument
738 return Math.addExact(x, y); in addExact()
752 public static long addExact(long x, long y) { in addExact() argument
753 return Math.addExact(x, y); in addExact()
767 public static int subtractExact(int x, int y) { in subtractExact() argument
768 return Math.subtractExact(x, y); in subtractExact()
782 public static long subtractExact(long x, long y) { in subtractExact() argument
783 return Math.subtractExact(x, y); in subtractExact()
797 public static int multiplyExact(int x, int y) { in multiplyExact() argument
[all …]
DMath.java520 public static native double atan2(double y, double x); in atan2() argument
822 public static int addExact(int x, int y) { in addExact() argument
823 int r = x + y; in addExact()
825 if (((x ^ r) & (y ^ r)) < 0) { in addExact()
841 public static long addExact(long x, long y) { in addExact() argument
842 long r = x + y; in addExact()
844 if (((x ^ r) & (y ^ r)) < 0) { in addExact()
860 public static int subtractExact(int x, int y) { in subtractExact() argument
861 int r = x - y; in subtractExact()
864 if (((x ^ y) & (x ^ r)) < 0) { in subtractExact()
[all …]
DLong.java1256 public static int compare(long x, long y) { in compare() argument
1257 return (x < y) ? -1 : ((x == y) ? 0 : 1); in compare()
1272 public static int compareUnsigned(long x, long y) { in compareUnsigned() argument
1273 return compare(x + MIN_VALUE, y + MIN_VALUE); in compareUnsigned()
1452 int x, y; in numberOfTrailingZeros() local
1455 y = (int)i; if (y != 0) { n = n -32; x = y; } else x = (int)(i>>>32); in numberOfTrailingZeros()
1456 y = x <<16; if (y != 0) { n = n -16; x = y; } in numberOfTrailingZeros()
1457 y = x << 8; if (y != 0) { n = n - 8; x = y; } in numberOfTrailingZeros()
1458 y = x << 4; if (y != 0) { n = n - 4; x = y; } in numberOfTrailingZeros()
1459 y = x << 2; if (y != 0) { n = n - 2; x = y; } in numberOfTrailingZeros()
/libcore/ojluni/src/main/java/java/security/spec/
DECPoint.java42 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()
DDSAPublicKeySpec.java47 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/
DBiPredicateTest.java37 … (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 …]
DBiFunctionTest.java27 BiFunction<Integer, Integer, Integer> add = (x, y) -> x + y; in testAndThen()
33 BiFunction<Integer, Integer, Integer> add = (x, y) -> x + y; in testAndThen_nullFunction()
41 BiFunction<Integer, Integer, Integer> toNull = (x, y) -> null; in testAndThen_nullResult()
/libcore/luni/src/main/java/libcore/util/
DFP16.java303 public static int compare(short x, short y) { in compare() argument
304 if (less(x, y)) return -1; in compare()
305 if (greater(x, y)) return 1; in compare()
311 short yBits = isNaN(y) ? NaN : y; in compare()
500 public static short min(short x, short y) { in min() argument
502 if (isNaN(y)) return NaN; in min()
504 if ((x & EXPONENT_SIGNIFICAND_MASK) == 0 && (y & EXPONENT_SIGNIFICAND_MASK) == 0) { in min()
505 return (x & SIGN_MASK) != 0 ? x : y; in min()
509 ((y & SIGN_MASK) != 0 ? 0x8000 - (y & 0xffff) : y & 0xffff) ? x : y; in min()
529 public static short max(short x, short y) { in max() argument
[all …]
/libcore/luni/src/main/native/
Djava_lang_StringToReal.cpp273 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/
DCalendarUtils.java135 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/benchmarks/src/benchmarks/regression/
DBigIntegerBenchmark.java26 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/
DDHPublicKeySpec.java46 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/luni/src/test/java/libcore/java/util/
DArraysTest.java282 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/
DShortTest.java65 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()
DByteTest.java65 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()
/libcore/ojluni/src/test/java/util/concurrent/tck/
DConcurrentHashMap8Test.java120 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 …]
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentHashMap8Test.java96 map.computeIfPresent(six, (x, y) -> "Z"); in testComputeIfPresent()
105 assertEquals("Z", map.computeIfPresent(one, (x, y) -> "Z")); in testComputeIfPresent2()
113 map.compute(six, (x, y) -> null); in testCompute()
122 assertEquals("Z", map.compute(six, (x, y) -> "Z")); in testCompute2()
130 assertEquals("Z", map.compute(one, (x, y) -> "Z")); in testCompute3()
138 map.compute(one, (x, y) -> null); in testCompute4()
147 assertEquals("Y", map.merge(six, "Y", (x, y) -> "Z")); in testMerge1()
155 assertEquals("Z", map.merge(one, "Y", (x, y) -> "Z")); in testMerge2()
163 map.merge(one, "Y", (x, y) -> null); in testMerge3()
192 map.replaceAll((x, y) -> { return x > 3 ? "Z" : y; }); in testReplaceAll() argument
[all …]
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DLambdaTestHelpers.java63 public static final BiConsumer bBiEmpty = (x,y) -> { };
67 public static final BiConsumer bBiHashCode = (x,y) -> { Objects.hash(x, y); };
98 public static final BinaryOperator<Integer> rPlus = (x, y) -> x+y;
99 public static final BinaryOperator<Integer> rMax = (x, y) -> Math.max(x, y);
100 public static final BinaryOperator<Integer> rMin = (x, y) -> Math.min(x,y);
101 public static final IntBinaryOperator irPlus = (x, y) -> x+y;
102 public static final IntBinaryOperator irMax = (x, y) -> Math.max(x, y);
103 public static final IntBinaryOperator irMin = (x, y) -> Math.min(x,y);
105 public static final LongBinaryOperator lrPlus = (x, y) -> x+y;
106 public static final DoubleBinaryOperator drPlus = (x, y) -> x+y;
[all …]
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DLambdaTestHelpers.java62 public static final BiConsumer bBiEmpty = (x,y) -> { };
66 public static final BiConsumer bBiHashCode = (x,y) -> { Objects.hash(x, y); };
97 public static final BinaryOperator<Integer> rPlus = (x, y) -> x+y;
98 public static final BinaryOperator<Integer> rMax = (x, y) -> Math.max(x, y);
99 public static final BinaryOperator<Integer> rMin = (x, y) -> Math.min(x,y);
100 public static final IntBinaryOperator irPlus = (x, y) -> x+y;
101 public static final IntBinaryOperator irMax = (x, y) -> Math.max(x, y);
102 public static final IntBinaryOperator irMin = (x, y) -> Math.min(x,y);
104 public static final LongBinaryOperator lrPlus = (x, y) -> x+y;
105 public static final DoubleBinaryOperator drPlus = (x, y) -> x+y;
[all …]
/libcore/ojluni/src/main/java/java/util/
DDate.java244 int y = year + 1900; in Date() local
247 y += month / 12; in Date()
250 y += CalendarUtils.floorDivide(month, 12); in Date()
253 BaseCalendar cal = getCalendarSystem(y); in Date()
255 cdate.setNormalizedDate(y, month + 1, date).setTimeOfDay(hrs, min, sec, 0); in Date()
319 int y = year + 1900; in UTC() local
322 y += month / 12; in UTC()
325 y += CalendarUtils.floorDivide(month, 12); in UTC()
329 BaseCalendar cal = getCalendarSystem(y); in UTC()
331 udate.setNormalizedDate(y, m, date).setTimeOfDay(hrs, min, sec, 0); in UTC()
[all …]

123456789