/libcore/ojluni/src/test/java/lang/Math/ |
D | Clamp.java | 72 int max = Math.toIntExact(test[2]); in testIntClamp() local 74 …kEquals("(int) Math.clamp(" + value + ", " + min + ", " + max + ")", Math.clamp(value, min, max), … in testIntClamp() 75 …(int) StrictMath.clamp(" + value + ", " + min + ", " + max + ")", StrictMath.clamp(value, min, max… in testIntClamp() 80 int max = Math.toIntExact(test[2]); in testIntClamp() local 81 …lures += checkIllegalArgumentException("(int) Math.clamp(" + value + ", " + min + ", " + max + ")", in testIntClamp() 82 () -> Math.clamp(value, min, max)); in testIntClamp() 83 …+= checkIllegalArgumentException("(int) StrictMath.clamp(" + value + ", " + min + ", " + max + ")", in testIntClamp() 84 () -> StrictMath.clamp(value, min, max)); in testIntClamp() 112 long max = test[2]; in testLongClamp() local 114 …Equals("(long) Math.clamp(" + value + ", " + min + ", " + max + ")", Math.clamp(value, min, max), … in testLongClamp() [all …]
|
D | MinMax.java | 71 test("Math.max(fnz, fnz)", Math.max(fnz, fnz), fnz); in testMinMax() 72 test("Math.max(fnz, fpz)", Math.max(fnz, fpz), fpz); in testMinMax() 73 test("Math.max(fpz, fnz)", Math.max(fpz, fnz), fpz); in testMinMax() 74 test("Math.max(fpz, fpz)", Math.max(fpz, fpz), fpz); in testMinMax() 76 test("Math.max(-1.0f, fnz)", Math.max(-1.0f, fnz), fnz); in testMinMax() 77 test("Math.max(-1.0f, fpz)", Math.max(-1.0f, fpz), fpz); in testMinMax() 78 test("Math.max(+1.0f, fnz)", Math.max(+1.0f, fnz), +1.0f); in testMinMax() 79 test("Math.max(+1.0f, fpz)", Math.max(+1.0f, fpz), +1.0f); in testMinMax() 80 test("Math.max(-1.0f, +1.0f)", Math.max(-1.0f, +1.0f), +1.0f); in testMinMax() 81 test("Math.max(fnz, -1.0f)", Math.max(fnz, -1.0f), fnz); in testMinMax() [all …]
|
/libcore/ojluni/src/main/java/java/util/ |
D | IntSummaryStatistics.java | 69 private int max = Integer.MIN_VALUE; field in IntSummaryStatistics 108 public IntSummaryStatistics(long count, int min, int max, long sum) in IntSummaryStatistics() argument 113 if (min > max) throw new IllegalArgumentException("Minimum greater than maximum"); in IntSummaryStatistics() 118 this.max = max; in IntSummaryStatistics() 133 max = Math.max(max, value); in accept() 146 max = Math.max(max, other.max); in combine() 185 return max; in getMax()
|
D | LongSummaryStatistics.java | 70 private long max = Long.MIN_VALUE; field in LongSummaryStatistics 109 public LongSummaryStatistics(long count, long min, long max, long sum) in LongSummaryStatistics() argument 114 if (min > max) throw new IllegalArgumentException("Minimum greater than maximum"); in LongSummaryStatistics() 119 this.max = max; in LongSummaryStatistics() 144 max = Math.max(max, value); in accept() 158 max = Math.max(max, other.max); in combine() 197 return max; in getMax()
|
D | DoubleSummaryStatistics.java | 72 private double max = Double.NEGATIVE_INFINITY; field in DoubleSummaryStatistics 111 public DoubleSummaryStatistics(long count, double min, double max, double sum) in DoubleSummaryStatistics() argument 116 if (min > max) in DoubleSummaryStatistics() 120 var ncount = DoubleStream.of(min, max, sum).filter(Double::isNaN).count(); in DoubleSummaryStatistics() 129 this.max = max; in DoubleSummaryStatistics() 145 max = Math.max(max, value); in accept() 163 max = Math.max(max, other.max); in combine() 282 return max; in getMax()
|
/libcore/ojluni/src/test/java/util/Collections/ |
D | MinMax.java | 44 if (!Collections.max(s).equals("x")) in main() 45 throw new RuntimeException("2: " + Collections.max(s)); in main() 50 if (!Collections.max(s).equals("y")) in main() 51 throw new RuntimeException("4: " + Collections.max(s)); in main() 56 if (!Collections.max(s).equals("y")) in main() 57 throw new RuntimeException("6: " + Collections.max(s)); in main() 63 if (!Collections.max(s, Collections.reverseOrder()).equals("x")) in main() 64 throw new RuntimeException("2a: " + Collections.max(s)); in main() 69 if (!Collections.max(s, Collections.reverseOrder()).equals("x")) in main() 70 throw new RuntimeException("4a: " + Collections.max(s)); in main() [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | TimeUnitTest.java | 327 long max = Long.MAX_VALUE/ratio; in testConvertSaturate() local 328 assertEquals(max * ratio, y.convert(max, x)); in testConvertSaturate() 329 assertEquals(-max * ratio, y.convert(-max, x)); in testConvertSaturate() 330 assertEquals(max, x.convert(max * ratio, y)); in testConvertSaturate() 331 assertEquals(-max, x.convert(-max * ratio, y)); in testConvertSaturate() 332 if (max < Long.MAX_VALUE) { in testConvertSaturate() 333 assertEquals(Long.MAX_VALUE, y.convert(max + 1, x)); in testConvertSaturate() 334 assertEquals(Long.MIN_VALUE, y.convert(-max - 1, x)); in testConvertSaturate() 356 long max = Long.MAX_VALUE/ratio; in testToNanosSaturate() local 357 for (long z : new long[] {0, 1, -1, max, -max}) in testToNanosSaturate() [all …]
|
D | DoubleAccumulatorTest.java | 55 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testConstructor() 63 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testAccumulateAndGet() 76 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testReset() 87 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testGetThenReset() 98 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testToString() 108 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testIntValue() 118 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testLongValue() 128 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testFloatValue() 138 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testDoubleValue() 151 DoubleAccumulator a = new DoubleAccumulator(Double::max, 0.0); in testAccumulateAndGetMT()
|
D | LongAccumulatorTest.java | 55 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testConstructor() 63 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testAccumulateAndGet() 76 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testReset() 87 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testGetThenReset() 98 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testToString() 108 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testIntValue() 118 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testLongValue() 128 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testFloatValue() 138 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testDoubleValue() 151 LongAccumulator a = new LongAccumulator(Long::max, 0L); in testAccumulateAndGetMT()
|
/libcore/luni/src/main/java/org/xml/sax/helpers/ |
D | AttributesImpl.java | 203 int max = length * 5; in getIndex() local 204 for (int i = 0; i < max; i += 5) { in getIndex() 222 int max = length * 5; in getIndex() local 223 for (int i = 0; i < max; i += 5) { in getIndex() 244 int max = length * 5; in getType() local 245 for (int i = 0; i < max; i += 5) { in getType() 264 int max = length * 5; in getType() local 265 for (int i = 0; i < max; i += 5) { in getType() 286 int max = length * 5; in getValue() local 287 for (int i = 0; i < max; i += 5) { in getValue() [all …]
|
/libcore/ojluni/src/test/java/io/InputStream/ |
D | ReadNBytes.java | 100 static void test(int max) throws IOException { in test() argument 101 byte[] inputBytes = max <= 0 ? new byte[0] : createRandomBytes(max); in test() 105 if (max < 0) { in test() 107 in.readNBytes(max); in test() 112 } else if (max == 0) { in test() 114 check((x = in.readNBytes(max).length) == 0, in test() 119 int off = Math.toIntExact(in.skip(generator.nextInt(max/2))); in test() 120 int len = generator.nextInt(max - 1 - off); in test() 128 int remaining = max - (off + len); in test() 132 check(Arrays.equals(Arrays.copyOfRange(inputBytes, off + len, max), in test() [all …]
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | MinMaxTest.java | 56 assertTrue(!countTo(0).stream().max(Integer::compare).isPresent()); in testMinMax() 58 assertEquals(1000, (int) countTo(1000).stream().max(Integer::compare).get()); in testMinMax() 64 exerciseTerminalOps(data, s -> s.max(Integer::compare)); in testOps() 69 assertEquals(IntStream.empty().max(), OptionalInt.empty()); in testIntMinMax() 71 assertEquals(1000, IntStream.range(1, 1001).max().getAsInt()); in testIntMinMax() 77 exerciseTerminalOps(data, s -> s.max()); in testIntOps() 82 assertEquals(LongStream.empty().max(), OptionalLong.empty()); in testLongMinMax() 84 assertEquals(1000, LongStream.range(1, 1001).max().getAsLong()); in testLongMinMax() 90 exerciseTerminalOps(data, s -> s.max()); in testLongOps() 95 assertEquals(DoubleStream.empty().max(), OptionalDouble.empty()); in testDoubleMinMax() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | DoubleAccumulatorTest.java | 32 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testConstructor() 40 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testAccumulateAndGet() 53 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testReset() 64 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testGetThenReset() 75 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testToString() 85 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testIntValue() 95 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testLongValue() 105 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testFloatValue() 115 DoubleAccumulator ai = new DoubleAccumulator(Double::max, 0.0); in testDoubleValue() 128 DoubleAccumulator a = new DoubleAccumulator(Double::max, 0.0); in testAccumulateAndGetMT()
|
D | LongAccumulatorTest.java | 32 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testConstructor() 40 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testAccumulateAndGet() 53 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testReset() 64 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testGetThenReset() 75 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testToString() 85 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testIntValue() 95 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testLongValue() 105 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testFloatValue() 115 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testDoubleValue() 128 LongAccumulator a = new LongAccumulator(Long::max, 0L); in testAccumulateAndGetMT()
|
D | TreeSetTest.java | 716 void mutateSet(NavigableSet<Integer> set, int min, int max) { in mutateSet() argument 718 int rangeSize = max - min + 1; in mutateSet() 736 assertTrue(element >= min && element <= max); in mutateSet() 741 void mutateSubSet(NavigableSet<Integer> set, int min, int max) { in mutateSubSet() argument 743 int rangeSize = max - min + 1; in mutateSubSet() 761 if (element >= min && element <= max) { in mutateSubSet() 783 int min, int max, boolean ascending) { in bashSubSet() argument 784 check(set, min, max, ascending); in bashSubSet() 785 check(set.descendingSet(), min, max, !ascending); in bashSubSet() local 787 mutateSubSet(set, min, max); in bashSubSet() [all …]
|
/libcore/ojluni/src/main/java/sun/security/util/ |
D | PropertyExpander.java | 71 int max = value.length(); in expand() local 75 while (p < max) { in expand() 84 if (pe < max && value.charAt(pe) == '{') { in expand() 86 if (pe == -1 || pe+2 == max) { in expand() 96 while ((pe < max) && (value.charAt(pe) != '}')) { in expand() 99 if (pe == max) { in expand() 134 if (i < max) { in expand() 135 sb.append(value.substring(i, max)); in expand()
|
/libcore/ojluni/src/main/java/java/lang/ |
D | StrictMath.java | 1731 public static int max(int a, int b) { in max() method in StrictMath 1732 return Math.max(a, b); in max() 1745 public static long max(long a, long b) { in max() method in StrictMath 1746 return Math.max(a, b); in max() 1764 public static float max(float a, float b) { in max() method in StrictMath 1765 return Math.max(a, b); in max() 1783 public static double max(double a, double b) { in max() method in StrictMath 1784 return Math.max(a, b); in max() 1873 public static int clamp(long value, int min, int max) { in clamp() argument 1874 return Math.clamp(value, min, max); in clamp() [all …]
|
D | Math.java | 2166 public static int max(int a, int b) { in max() method in Math 2180 public static long max(long a, long b) { in max() method in Math 2207 public static float max(float a, float b) { in max() method in Math 2238 public static double max(double a, double b) { in max() method in Math 2360 public static int clamp(long value, int min, int max) { in clamp() argument 2361 if (min > max) { in clamp() 2362 throw new IllegalArgumentException(min + " > " + max); in clamp() 2364 return (int) Math.min(max, Math.max(value, min)); in clamp() 2381 public static long clamp(long value, long min, long max) { in clamp() argument 2382 if (min > max) { in clamp() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | ByteTest.java | 23 final byte max = Byte.MAX_VALUE; in test_compare() 24 assertTrue(Byte.compare(max, max) == 0); in test_compare() 27 assertTrue(Byte.compare(max, zero) > 0); in test_compare() 28 assertTrue(Byte.compare(max, min) > 0); in test_compare() 29 assertTrue(Byte.compare(zero, max) < 0); in test_compare() 32 assertTrue(Byte.compare(min, max) < 0); in test_compare()
|
D | ShortTest.java | 23 final short max = Short.MAX_VALUE; in test_compare() local 24 assertTrue(Short.compare(max, max) == 0); in test_compare() 27 assertTrue(Short.compare(max, zero) > 0); in test_compare() 28 assertTrue(Short.compare(max, min) > 0); in test_compare() 29 assertTrue(Short.compare(zero, max) < 0); in test_compare() 32 assertTrue(Short.compare(min, max) < 0); in test_compare()
|
D | LongTest.java | 41 final long max = Long.MAX_VALUE; in testCompare() local 42 assertTrue(Long.compare(max, max) == 0); in testCompare() 45 assertTrue(Long.compare(max, zero) > 0); in testCompare() 46 assertTrue(Long.compare(max, min) > 0); in testCompare() 47 assertTrue(Long.compare(zero, max) < 0); in testCompare() 50 assertTrue(Long.compare(min, max) < 0); in testCompare() 149 assertEquals(Math.max(a, b), Long.max(a, b));
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | LoopingBackwardsBenchmark.java | 27 @Param({"2", "20", "2000", "20000000"}) int max; field in LoopingBackwardsBenchmark 32 for (int j = 0; j < max; j++) { in timeForwards() 42 for (int j = max - 1; j >= 0; j--) { in timeBackwards()
|
/libcore/ojluni/src/test/java/lang/invoke/ |
D | MethodHandlesPermuteArgumentsTest.java | 67 …public void testPermuteArguments(int max, Class<?> type1, int t2c, Class<?> type2, int dilution) t… in testPermuteArguments() argument 69 System.out.println("permuteArguments "+max+"*"+type1.getName() in testPermuteArguments() 73 for (int inargs = t2pos+1; inargs <= max; inargs++) { in testPermuteArguments() 82 for (int outargs = 0; outargs <= max; outargs++) { in testPermuteArguments() 91 if (CAN_TEST_LIGHTLY && outargs < max-2) continue; in testPermuteArguments() 156 int max = 0; in testPermuteArguments() local 158 if (max < j) max = j; in testPermuteArguments() 160 args = randomArgs(max+1, Integer.class); in testPermuteArguments()
|
/libcore/ojluni/src/test/java/lang/StackWalker/ |
D | MultiThreadStackWalk.java | 96 final long max; // constant: the maximum number of recursive field in MultiThreadStackWalk.Env 111 this.max = total+2; in Env() 123 max = orig.max; in Env() 155 if (count == max) { in consume() 167 …} else if (count > 0 && count < max && sfi.getDeclaringClass() != MultiThreadStackWalk.Test.class)… in consume() 170 } else if (count == max && sfi.getDeclaringClass() != MultiThreadStackWalk.class) { in consume() 173 … } else if (count == max && !sfi.toStackTraceElement().getMethodName().equals("runTest")) { in consume() 176 } else if (count == max+1) { in consume() 181 if (count == max && !sfi.toStackTraceElement().getMethodName().equals("run")) { in consume() 185 } else if (count > max+1) { in consume()
|
/libcore/ojluni/src/main/java/java/lang/constant/ |
D | DirectMethodHandleDesc.java | 152 int max = 0; 154 max = Math.max(max, tableIndex(k.refKind, true)); 156 TABLE = new Kind[max+1];
|