Home
last modified time | relevance | path

Searched refs:NaN (Results 1 – 25 of 60) sorted by relevance

123

/libcore/ojluni/src/test/java/util/stream/
DTestDoubleSumAverage.java115 testCases.put(() -> DoubleStream.of(1.0d, NaN, 1.0d), NaN); in testNonfiniteSum()
116 testCases.put(() -> DoubleStream.of(NaN), NaN); in testNonfiniteSum() local
117 testCases.put(() -> DoubleStream.of(1.0d, NEGATIVE_INFINITY, POSITIVE_INFINITY, 1.0d), NaN); in testNonfiniteSum()
118 testCases.put(() -> DoubleStream.of(1.0d, POSITIVE_INFINITY, NEGATIVE_INFINITY, 1.0d), NaN); in testNonfiniteSum()
119 testCases.put(() -> DoubleStream.of(POSITIVE_INFINITY, NaN), NaN); in testNonfiniteSum() local
120 testCases.put(() -> DoubleStream.of(NEGATIVE_INFINITY, NaN), NaN); in testNonfiniteSum() local
121 testCases.put(() -> DoubleStream.of(NaN, POSITIVE_INFINITY), NaN); in testNonfiniteSum() local
122 testCases.put(() -> DoubleStream.of(NaN, NEGATIVE_INFINITY), NaN); in testNonfiniteSum() local
/libcore/luni/src/test/java/libcore/libcore/util/
DFP16Test.java34 assertEquals(NaN, toHalf(Float.NaN)); in testSingleToHalf()
73 assertEquals(Float.NaN, toFloat(toHalf(Float.NaN)), 0.0f); in testHalfToSingle()
90 assertEquals("NaN", toHexString(NaN)); in testHexString()
112 assertFalse(FP16.isInfinite(NaN)); in testIsInfinite()
124 assertTrue(FP16.isNaN(NaN)); in testIsNaN()
140 assertFalse(FP16.isNormalized(NaN)); in testIsNormalized()
158 assertEquals(NaN, FP16.ceil(NaN)); in testCeil()
185 assertFalse(FP16.equals(NaN, toHalf(12.4f))); in testEquals()
186 assertFalse(FP16.equals(toHalf(12.4f), NaN)); in testEquals()
187 assertFalse(FP16.equals(NaN, NaN)); in testEquals()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DDoubleSummaryStatisticsTest.java65 dss1.accept(Double.NaN); in test_getSum()
66 assertEquals(Double.NaN, dss1.getSum()); in test_getSum()
73 dss1.accept(Double.NaN); in test_getMin()
74 assertEquals(Double.NaN, dss1.getMin()); in test_getMin()
81 dss1.accept(Double.NaN); in test_getMax()
82 assertEquals(Double.NaN, dss1.getMax()); in test_getMax()
89 dss1.accept(Double.NaN); in test_getAverage()
90 assertEquals(Double.NaN, dss1.getAverage()); in test_getAverage()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DMathTest.java123 assertTrue(Double.isNaN(Math.cbrt(Double.NaN))); in test_cbrt_D()
178 magnitude, Double.NaN))); in test_copySign_DD()
180 Double.NaN, magnitude))); in test_copySign_DD()
202 Double.NaN, Double.NaN))); in test_copySign_DD()
250 magnitude, Float.NaN))); in test_copySign_FF()
252 Float.NaN, magnitude))); in test_copySign_FF()
273 Float.NaN, Float.NaN))); in test_copySign_FF()
309 assertTrue(Double.isNaN(Math.cosh(Double.NaN))); in test_cosh_D()
350 assertTrue("Should return NaN", Double.isNaN(Math.expm1(Double.NaN))); in test_expm1_D()
392 Double.toString(Double.NaN), Double.toString(Math.floor(Double.NaN))); in test_floorD()
[all …]
DStrictMathTest.java131 .cbrt(Double.NaN))); in test_cbrt_D()
194 .copySign(magnitude, Double.NaN))); in test_copySign_DD()
196 .copySign(Double.NaN, magnitude))); in test_copySign_DD()
218 .copySign(Double.NaN, Double.NaN))); in test_copySign_DD()
259 magnitude, Float.NaN))); in test_copySign_FF()
261 .copySign(Float.NaN, magnitude))); in test_copySign_FF()
282 .copySign(Float.NaN, Float.NaN))); in test_copySign_FF()
324 .cosh(Double.NaN))); in test_cosh_D()
369 assertTrue("Should return NaN", Double.isNaN(StrictMath.expm1(Double.NaN))); in test_expm1_D()
471 assertTrue("Should return NaN", Double.isNaN(StrictMath.hypot(Double.NaN, in test_hypot_DD()
[all …]
DFloatTest.java134 Float.POSITIVE_INFINITY, Float.NaN }; in test_compare()
259 assertFalse(Float.isInfinite(Float.NaN)); in test_isInfiniteF()
272 assertFalse(Float.isFinite(Float.NaN)); in test_isFiniteF()
281 assertTrue("NAN check failed", new Float(Float.NaN).isNaN() in test_isNaN()
290 assertTrue("NaN check failed", Float.isNaN(Float.NaN) && !(Float.isNaN(12.09f))); in test_isNaNF()
908 Float expectedNaN = new Float(Float.NaN); in test_valueOfLjava_lang_String()
956 Float.POSITIVE_INFINITY, Float.NaN }; in test_compareToLjava_lang_Float()
996 assertTrue("Assert 1: NaN should not be == Nan", Float.NaN != Float.NaN); in test_equalsLjava_lang_Object()
997 assertTrue("Assert 2: NaN should not be == Nan", new Float(Float.NaN).equals(new Float( in test_equalsLjava_lang_Object()
998 Float.NaN))); in test_equalsLjava_lang_Object()
[all …]
DDoubleTest.java250 Double.POSITIVE_INFINITY, Double.NaN }; in test_compare()
365 assertFalse(Double.isInfinite(Double.NaN)); in test_isInfiniteD()
378 assertFalse(Double.isFinite(Double.NaN)); in test_isFiniteD()
1297 Double expectedNaN = new Double(Double.NaN); in test_valueOfLjava_lang_String()
1328 Double.POSITIVE_INFINITY, Double.NaN }; in test_compareToLjava_lang_Double()
1372 assertTrue("Assert 2: NaN should not be == Nan", Double.NaN != Double.NaN); in test_equalsLjava_lang_Object()
1373 assertTrue("Assert 3: NaN should not be == Nan", new Double(Double.NaN) in test_equalsLjava_lang_Object()
1374 .equals(new Double(Double.NaN))); in test_equalsLjava_lang_Object()
1402 assertEquals("NaN", Double.toHexString(Double.NaN)); in test_toHexStringF()
/libcore/luni/src/test/java/libcore/java/lang/
DOldFloatTest.java54 assertEquals(0x7fc00000, Float.floatToIntBits(Float.NaN)); in test_floatToIntBitsF()
60 assertEquals(0x7fc00000, Float.floatToRawIntBits(Float.NaN)); in test_floatToRawIntBitsF()
71 assertEquals(Float.NaN, Float.intBitsToFloat(0x7f800001)); in test_intBitsToFloatI()
72 assertEquals(Float.NaN, Float.intBitsToFloat(0x7fffffff)); in test_intBitsToFloatI()
73 assertEquals(Float.NaN, Float.intBitsToFloat(0xff800001)); in test_intBitsToFloatI()
74 assertEquals(Float.NaN, Float.intBitsToFloat(0xffffffff)); in test_intBitsToFloatI()
DOldAndroidStrictMathTest.java96 .cbrt(Double.NaN))); in testCbrtD()
151 .cosh(Double.NaN))); in testCosh_D()
190 assertTrue("Should return NaN", Double.isNaN(StrictMath.expm1(Double.NaN))); in testExpm1D()
245 assertTrue("Should return NaN", Double.isNaN(StrictMath.hypot(Double.NaN, in testHypotDD()
248 Double.NaN))); in testHypotDD()
287 .log10(Double.NaN))); in testLog10D()
318 .log1p(Double.NaN))); in testLog1pD()
438 .rint(Double.NaN))); in testRintD()
458 assertTrue(Double.isNaN(StrictMath.signum(Double.NaN))); in testSignumD()
481 assertTrue(Float.isNaN(StrictMath.signum(Float.NaN))); in testSignumF()
[all …]
DOldAndroidMathTest.java156 .cbrt(Double.NaN))); in testCbrtD()
201 assertTrue(Double.isNaN(Math.cosh(Double.NaN))); in testCoshD()
236 assertTrue("Should return NaN", Double.isNaN(Math.expm1(Double.NaN))); in testExpm1D()
289 assertTrue("Should be NaN", Double.isNaN(Math.hypot(Double.NaN, in testHypotDD()
292 Double.NaN))); in testHypotDD()
326 assertTrue(Double.isNaN(Math.log10(Double.NaN))); in testLog10D()
345 assertTrue("Should return NaN", Double.isNaN(Math.log1p(Double.NaN))); in testLog1pD()
463 .rint(Double.NaN))); in testRintD()
481 assertTrue(Double.isNaN(Math.signum(Double.NaN))); in testSignumD()
482 assertTrue(Double.isNaN(Math.signum(Double.NaN))); in testSignumD()
[all …]
DDoubleTest.java34 assertEquals(Double.NaN, Double.parseDouble("NaN")); in testNamedDoubles()
35 assertEquals(Double.NaN, Double.parseDouble("-NaN")); in testNamedDoubles()
36 assertEquals(Double.NaN, Double.parseDouble("+NaN")); in testNamedDoubles()
DFloatTest.java36 assertEquals(Float.NaN, Float.parseFloat("NaN")); in testNamedFloats()
37 assertEquals(Float.NaN, Float.parseFloat("-NaN")); in testNamedFloats()
38 assertEquals(Float.NaN, Float.parseFloat("+NaN")); in testNamedFloats()
DOldDoubleTest.java33 assertEquals(0x7ff8000000000000L, Double.doubleToLongBits(Double.NaN)); in test_doubleToLongBitsD()
39 assertEquals(0x7ff8000000000000L, Double.doubleToLongBits(Double.NaN)); in test_doubleToRawLongBitsD()
/libcore/ojluni/src/main/java/java/text/
DDecimalFormatSymbols.java340 return NaN; in getNaN()
349 public void setNaN(String NaN) { in setNaN() argument
350 this.NaN = NaN; in setNaN()
609 NaN.equals(other.NaN) && in equals()
633 result = result * 37 + NaN.hashCode(); in hashCode()
677 values[10] = localeData.NaN; in initialize()
695 NaN = numberElements[10]; in initialize()
793 cachedIcuDFS.setNaN(NaN); in getIcuDecimalFormatSymbols()
888 fields.put("NaN", NaN); in writeObject()
934 NaN = (String) fields.get("NaN", ""); in readObject()
[all …]
/libcore/ojluni/src/main/java/sun/misc/
DDoubleConsts.java43 public static final double NaN = java.lang.Double.NaN; field in DoubleConsts
DFloatConsts.java43 public static final float NaN = java.lang.Float.NaN; field in FloatConsts
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DArrays2Test.java41 Double.POSITIVE_INFINITY, Double.NaN }; in test_binarySearch$DD()
61 Float.NaN }; in test_binarySearch$FF()
92 Arrays.equals(new double[] { Double.NaN }, new double[] { Double.NaN })); in test_equals$D$D()
112 Arrays.equals(new float[] { Float.NaN }, new float[] { Float.NaN })); in test_equals$F$F()
133 …double[] specials1 = new double[] { Double.NaN, Double.MAX_VALUE, Double.MIN_VALUE, 0d, -0d, Doubl… in test_sort$D()
134 …POSITIVE_INFINITY, -0d, Double.NEGATIVE_INFINITY, Double.MIN_VALUE, Double.NaN, Double.MAX_VALUE }; in test_sort$D()
135 …TIVE_INFINITY, -0d, 0d, Double.MIN_VALUE, Double.MAX_VALUE, Double.POSITIVE_INFINITY, Double.NaN }; in test_sort$D()
169 …float[] specials1 = new float[] { Float.NaN, Float.MAX_VALUE, Float.MIN_VALUE, 0f, -0f, Float.POSI… in test_sort$F()
170 …oat.POSITIVE_INFINITY, -0f, Float.NEGATIVE_INFINITY, Float.MIN_VALUE, Float.NaN, Float.MAX_VALUE }; in test_sort$F()
171 …NEGATIVE_INFINITY, -0f, 0f, Float.MIN_VALUE, Float.MAX_VALUE, Float.POSITIVE_INFINITY, Float.NaN }; in test_sort$F()
DFormatterTest.java2799 { Float.NaN, "%e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2800 { Float.NaN, "%#.0e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2801 { Float.NaN, "%#- (9.8e", "NaN " }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2802 { Float.NaN, "%#+0(8.4e", " NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2803 { Float.NaN, "%-+(1.6e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2804 { Float.NaN, "% 0(12e", " NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2899 { Double.NaN, "%e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2900 { Double.NaN, "%#.0e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2901 { Double.NaN, "%#- (9.8e", "NaN " }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2902 { Double.NaN, "%#+0(8.4e", " NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
[all …]
/libcore/luni/src/main/java/libcore/util/
DFP16.java171 public static final short NaN = (short) 0x7e00; field in FP16
310 short xBits = isNaN(x) ? NaN : x; in compare()
311 short yBits = isNaN(y) ? NaN : y; in compare()
356 result |= NaN; in rint()
400 result |= NaN; in ceil()
443 result |= NaN; in floor()
501 if (isNaN(x)) return NaN; in min()
502 if (isNaN(y)) return NaN; in min()
530 if (isNaN(x)) return NaN; in max()
531 if (isNaN(y)) return NaN; in max()
/libcore/luni/src/test/java/libcore/java/util/function/
DDoubleUnaryOperatorTest.java29 assertEquals(Double.NaN, DoubleUnaryOperator.identity().applyAsDouble(Double.NaN)); in testIdentity()
/libcore/json/src/test/java/libcore/org/json/
DJSONObjectTest.java101 assertEquals(Double.NaN, object.optDouble("foo")); in testEmptyObject()
192 object.putOpt("foo", Double.NaN); in testPutOptUnsupportedNumbers()
322 object.put("foo", (Float) Float.NaN); in testFloats()
350 return Double.NaN; in testOtherNumbers()
451 assertEquals(Double.NaN, object.optDouble("quux")); in testStrings()
513 object.accumulate("foo", Double.NaN); in testAccumulateValueChecking()
519 object.accumulate("foo", Double.NaN); in testAccumulateValueChecking()
525 object.accumulate("foo", Double.NaN); in testAccumulateValueChecking()
618 object.put("foo", Double.NaN); in testPutUnsupportedNumbers()
637 object.put("foo", (Double) Double.NaN); in testPutUnsupportedNumbersAsObjects()
[all …]
DJSONArrayTest.java299 assertEquals(Double.NaN, array.optDouble(3)); in testStrings()
399 array.put(Double.NaN); in testPutUnsupportedNumbers()
417 array.put(Double.valueOf(Double.NaN)); in testPutUnsupportedNumbersAsObject()
428 JSONArray array = new JSONArray(Arrays.asList(5.5, Double.NaN)); in testCreateWithUnsupportedNumbers()
431 assertEquals(Double.NaN, array.getDouble(1)); in testCreateWithUnsupportedNumbers()
436 JSONArray array = new JSONArray(Arrays.asList(5.5, Double.NaN)); in testToStringWithUnsupportedNumbers()
/libcore/luni/src/test/resources/
Dmath_java_only.csv93 log1p,NaN,-0x1.8ec3beb2d4185p1023
94 log1p,NaN,-0x1.a49ea827e7d05p1023
95 log1p,NaN,-0x1.47afe754a89fep1021
96 log1p,NaN,-0x1.ea33b08c7fbfbp1022
98 log1p,NaN,-0x1.d2762c5e7c22bp1022
100 log1p,NaN,-0x1.800e50b80ea85p1023
102 log1p,NaN,-0x1.6d6d5ccb7231fp1022
104 log1p,NaN,-0x1.46bd646b348a7p1022
109 log1p,NaN,-0x1.93b8dc284f903p1022
110 log1p,NaN,-0x1.1f03b54fdb6b3p1023
[all …]
/libcore/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/
DAnnotationTest.java265 @TestAnnotation3(f = Float.NaN)
267 @TestAnnotation3(f = Float.NaN)
294 @TestAnnotation3(d = Double.NaN)
296 @TestAnnotation3(d = Double.NaN)
/libcore/ojluni/annotations/hiddenapi/java/text/
DDecimalFormatSymbols.java140 public void setNaN(java.lang.String NaN) { in setNaN() argument
242 private java.lang.String NaN; field in DecimalFormatSymbols

123