Home
last modified time | relevance | path

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

1234

/libcore/luni/src/test/java/libcore/java/util/
DDoubleSummaryStatisticsTest.java69 dss1.accept(Double.NaN); in test_getSum()
70 assertEquals(Double.NaN, dss1.getSum()); in test_getSum()
77 dss1.accept(Double.NaN); in test_getMin()
78 assertEquals(Double.NaN, dss1.getMin()); in test_getMin()
85 dss1.accept(Double.NaN); in test_getMax()
86 assertEquals(Double.NaN, dss1.getMax()); in test_getMax()
93 dss1.accept(Double.NaN); in test_getAverage()
94 assertEquals(Double.NaN, dss1.getAverage()); in test_getAverage()
102 () -> new DoubleSummaryStatistics(1, Double.NaN, 0, 0)); in test_constructorLongDoubleDoubleDouble_throws_IAE_onInvalidArgumentsCombination()
104 () -> new DoubleSummaryStatistics(1, 0, Double.NaN, 0)); in test_constructorLongDoubleDoubleDouble_throws_IAE_onInvalidArgumentsCombination()
[all …]
/libcore/ojluni/src/test/java/lang/Math/
DFusedMultiplyAddTests.java50 private static final double NaN = Double.NaN; field in FusedMultiplyAddTests
51 private static final float NaNf = Float.NaN;
65 NaN, in testNonFiniteD()
69 NaN, in testNonFiniteD()
88 NaN, in testNonFiniteD()
92 NaN, in testNonFiniteD()
95 {1.0, NaN, 2.0, in testNonFiniteD()
96 NaN, in testNonFiniteD()
99 {1.0, 2.0, NaN, in testNonFiniteD()
100 NaN, in testNonFiniteD()
[all …]
DClamp.java161 {Double.NaN, 0.0, 1.0, Double.NaN}, in testDoubleClamp()
162 {Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN} in testDoubleClamp()
166 {0.0, Double.NaN, Double.NaN}, in testDoubleClamp()
167 {0.0, 0.0, Double.NaN}, in testDoubleClamp()
168 {0.0, Double.NaN, 0.0}, in testDoubleClamp()
169 {Double.NaN, 1.0, 0.0}, in testDoubleClamp()
225 {Float.NaN, 0.0f, 1.0f, Float.NaN}, in testFloatClamp()
226 {Float.NaN, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, Float.NaN} in testFloatClamp()
230 {0.0f, Float.NaN, Float.NaN}, in testFloatClamp()
231 {0.0f, 0.0f, Float.NaN}, in testFloatClamp()
[all …]
DPowTests.java162 Double.NaN in testCrossProduct()
165 double NaN = Double.NaN; in testCrossProduct() local
168 double expected = NaN; in testCrossProduct()
173 expected = NaN; in testCrossProduct()
181 expected = NaN; in testCrossProduct()
186 expected = NaN; in testCrossProduct()
192 expected = NaN; in testCrossProduct()
197 expected = NaN; in testCrossProduct()
204 expected = NaN; in testCrossProduct()
222 expected = NaN; in testCrossProduct()
[all …]
DLog10Tests.java41 static final double NaNd = Double.NaN;
58 {Double.NaN, NaNd}, in testLog10()
137 double z = Double.NaN; in testLog10()
148 double up = Double.NaN; in testLog10()
149 double down = Double.NaN; in testLog10()
DRoundTests.java80 Tests.test("Math.round", Float.NaN, Math.round(Float.NaN), 0.0F); in testSpecialCases()
95 Tests.test("Math.round", Double.NaN, Math.round(Double.NaN), 0.0); in testSpecialCases()
DAbsPositiveZero.java51 double dnanval = Math.abs(Double.NaN); in testAbsPositiveZero()
60 float fnanval = Math.abs(Float.NaN); in testAbsPositiveZero()
DRint.java95 {Double.NaN, Double.NaN} in testRint()
/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/ojluni/src/test/java/util/stream/
DTestDoubleSumAverage.java117 testCases.put(() -> DoubleStream.of(1.0d, NaN, 1.0d), NaN); in testNonfiniteSum()
118 testCases.put(() -> DoubleStream.of(NaN), NaN); in testNonfiniteSum() local
119 testCases.put(() -> DoubleStream.of(1.0d, NEGATIVE_INFINITY, POSITIVE_INFINITY, 1.0d), NaN); in testNonfiniteSum()
120 testCases.put(() -> DoubleStream.of(1.0d, POSITIVE_INFINITY, NEGATIVE_INFINITY, 1.0d), NaN); in testNonfiniteSum()
121 testCases.put(() -> DoubleStream.of(POSITIVE_INFINITY, NaN), NaN); in testNonfiniteSum() local
122 testCases.put(() -> DoubleStream.of(NEGATIVE_INFINITY, NaN), NaN); in testNonfiniteSum() local
123 testCases.put(() -> DoubleStream.of(NaN, POSITIVE_INFINITY), NaN); in testNonfiniteSum() local
124 testCases.put(() -> DoubleStream.of(NaN, NEGATIVE_INFINITY), NaN); in testNonfiniteSum() local
/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 …]
/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 …]
/libcore/luni/src/main/java/libcore/util/
DFP16.java161 public static final short NaN = (short) 0x7e00; field in FP16
288 short xBits = isNaN(x) ? NaN : x; in compare()
289 short yBits = isNaN(y) ? NaN : y; in compare()
333 result |= NaN; in rint()
376 result |= NaN; in ceil()
418 result |= NaN; in floor()
474 if (isNaN(x)) return NaN; in min()
475 if (isNaN(y)) return NaN; in min()
502 if (isNaN(x)) return NaN; in max()
503 if (isNaN(y)) return NaN; in max()
/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.java2795 { Float.NaN, "%e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2796 { Float.NaN, "%#.0e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2797 { Float.NaN, "%#- (9.8e", "NaN " }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2798 { Float.NaN, "%#+0(8.4e", " NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2799 { Float.NaN, "%-+(1.6e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2800 { Float.NaN, "% 0(12e", " NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2895 { Double.NaN, "%e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2896 { Double.NaN, "%#.0e", "NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2897 { Double.NaN, "%#- (9.8e", "NaN " }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
2898 { Double.NaN, "%#+0(8.4e", " NaN" }, in test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionE()
[all …]
/libcore/ojluni/src/test/java/util/Arrays/
DFloatDoubleOrder.java43 double[] unsortedDbl = new double[] {1.0d, 3.7d, Double.NaN, -2.0d, in test()
47 -0.0d, 0.0d, 1.0d, 3.7d, Double.POSITIVE_INFINITY, Double.NaN}; in test()
70 float[] unsortedFlt = new float[] {1.0f, 3.7f, Float.NaN, -2.0f, in test()
74 -0.0f, 0.0f, 1.0f, 3.7f, Float.POSITIVE_INFINITY, Float.NaN}; in test()
/libcore/ojluni/src/test/java/text/Format/NumberFormat/
DBigDecimalParse.java214 check("-0.00", Double.NaN); in test_Parse_in_DecimalFormat_BigDecimal_DivisionByZero()
235 check("0.0", Double.NaN); in test_Parse_in_DecimalFormat_Double_DivisionByZero()
239 check("-0.0", Double.NaN); in test_Parse_in_DecimalFormat_Double_DivisionByZero()
243 check("\ufffd", Double.NaN); in test_Parse_in_DecimalFormat_Double_DivisionByZero()
272 check("-000", Double.NaN); in test_Parse_in_DecimalFormat_Long_DivisionByZero()
357 Double.POSITIVE_INFINITY, Double.NaN, in test_Parse_in_DecimalFormat_SpecialNumber()
361 Double.NEGATIVE_INFINITY, Double.NaN, in test_Parse_in_DecimalFormat_SpecialNumber()
367 Double.NEGATIVE_INFINITY, Double.NaN, in test_Parse_in_DecimalFormat_SpecialNumber()
/libcore/ojluni/src/main/java/java/text/
DDecimalFormatSymbols.java361 return NaN; in getNaN()
370 public void setNaN(String NaN) { in setNaN() argument
372 this.NaN = NaN; in setNaN()
781 NaN.equals(other.NaN) && in equals()
810 NaN, in hashCode()
888 NaN = numberElements[10]; in initialize()
1035 cachedIcuDFS.setNaN(NaN);
1137 fields.put("NaN", NaN);
1199 NaN = (String) fields.get("NaN", "");
1350 private String NaN;
/libcore/ojluni/src/main/java/jdk/internal/math/
DDoubleConsts.java47 public static final double NaN = java.lang.Double.NaN; field in DoubleConsts
DFloatConsts.java47 public static final float NaN = java.lang.Float.NaN; field in FloatConsts
/libcore/luni/src/test/java/libcore/java/util/function/
DDoubleUnaryOperatorTest.java29 assertEquals(Double.NaN, DoubleUnaryOperator.identity().applyAsDouble(Double.NaN)); in testIdentity()

1234