Home
last modified time | relevance | path

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

12345678910

/libcore/ojluni/src/test/java/lang/Math/
DDivModTests.java90 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 …]
DPowTests.java167 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 …]
DExactArithTests.java74 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/ojluni/src/test/java/lang/StrictMath/
DExactArithTests.java97 static void testIntegerExact(int x, int y) { in testIntegerExact() argument
100 int sum = StrictMath.addExact(x, y); in testIntegerExact()
101 long sum2 = (long) x + (long) y; in testIntegerExact()
103 fail("FAIL: int StrictMath.addExact(" + x + " + " + y + ") = " + sum in testIntegerExact()
106 fail("FAIL: long StrictMath.addExact(" + x + " + " + y + ") = " + sum in testIntegerExact()
110 long sum2 = (long) x + (long) y; in testIntegerExact()
112 fail("FAIL: int StrictMath.addExact(" + x + " + " + y + ")" in testIntegerExact()
120 int diff = StrictMath.subtractExact(x, y); in testIntegerExact()
121 long diff2 = (long) x - (long) y; in testIntegerExact()
123 fail("FAIL: int StrictMath.subtractExact(" + x + " - " + y + ") = " + diff in testIntegerExact()
[all …]
DFdlibmTranslit.java73 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 …]
DMultiplicationTests.java61 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/luni/src/main/java/libcore/util/
DFP16.java281 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/main/java/java/lang/
DStrictMath.java538 public static native double atan2(double y, double x); in atan2() argument
758 public static int addExact(int x, int y) { in addExact() argument
759 return Math.addExact(x, y); in addExact()
773 public static long addExact(long x, long y) { in addExact() argument
774 return Math.addExact(x, y); in addExact()
788 public static int subtractExact(int x, int y) { in subtractExact() argument
789 return Math.subtractExact(x, y); in subtractExact()
803 public static long subtractExact(long x, long y) { in subtractExact() argument
804 return Math.subtractExact(x, y); in subtractExact()
818 public static int multiplyExact(int x, int y) { in multiplyExact() argument
[all …]
DMath.java649 public static native double atan2(double y, double x); in atan2() argument
971 public static int addExact(int x, int y) { in addExact() argument
972 int r = x + y; in addExact()
974 if (((x ^ r) & (y ^ r)) < 0) { in addExact()
991 public static long addExact(long x, long y) { in addExact() argument
992 long r = x + y; in addExact()
994 if (((x ^ r) & (y ^ r)) < 0) { in addExact()
1011 public static int subtractExact(int x, int y) { in subtractExact() argument
1012 int r = x - y; in subtractExact()
1015 if (((x ^ y) & (x ^ r)) < 0) { in subtractExact()
[all …]
/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()
DEdECPoint.java51 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()
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 …]
/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/ojluni/src/test/java/lang/invoke/
DPermuteArgsTest.java62 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 …]
DMethodHandlesTest.java430 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/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/ojluni/src/test/java/math/BigInteger/
DBigIntegerTest.java218 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/
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/
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()
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()
/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 …]

12345678910