Home
last modified time | relevance | path

Searched refs:Double (Results 1 – 25 of 301) sorted by relevance

12345678910>>...13

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DDoubleTest.java190 result = Double.parseDouble(originalDoubleString); in doTestCompareRawBits()
191 rawBits = Double.doubleToLongBits(result); in doTestCompareRawBits()
192 convertedString = new Double(result).toString(); in doTestCompareRawBits()
199 assertEquals(answer, Double.toString(dd)); in test_toString()
200 Double d = new Double(dd); in test_toString()
201 assertEquals(answer, Double.toString(d.doubleValue())); in test_toString()
209 Double d = new Double(39089.88888888888888888888888888888888); in test_ConstructorD()
218 Double d = new Double("39089.88888888888888888888888888888888"); in test_ConstructorLjava_lang_String()
224 d = new Double("1E+-20"); in test_ConstructorLjava_lang_String()
231 …d = Double.parseDouble("-1.23399999999999996511673809963093681727585202138420992908181304283780288… in test_ConstructorLjava_lang_String()
[all …]
DMathTest.java80 long lr = Double.doubleToLongBits(r); in test_acosD()
81 long t = Double.doubleToLongBits(ADJ / HYP); in test_acosD()
92 long lr = Double.doubleToLongBits(r); in test_asinD()
93 long t = Double.doubleToLongBits(OPP / HYP); in test_asinD()
123 assertTrue(Double.isNaN(Math.cbrt(Double.NaN))); in test_cbrt_D()
124 assertEquals(Double.POSITIVE_INFINITY, Math.cbrt(Double.POSITIVE_INFINITY), 0D); in test_cbrt_D()
125 assertEquals(Double.NEGATIVE_INFINITY, Math.cbrt(Double.NEGATIVE_INFINITY), 0D); in test_cbrt_D()
126 assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math.cbrt(0.0))); in test_cbrt_D()
127 assertEquals(Double.doubleToLongBits(+0.0), Double.doubleToLongBits(Math.cbrt(+0.0))); in test_cbrt_D()
128 assertEquals(Double.doubleToLongBits(-0.0), Double.doubleToLongBits(Math.cbrt(-0.0))); in test_cbrt_D()
[all …]
DStrictMathTest.java130 assertTrue("Should return Double.NaN", Double.isNaN(StrictMath in test_cbrt_D()
131 .cbrt(Double.NaN))); in test_cbrt_D()
133 Double.POSITIVE_INFINITY, StrictMath in test_cbrt_D()
134 .cbrt(Double.POSITIVE_INFINITY)); in test_cbrt_D()
136 Double.NEGATIVE_INFINITY, StrictMath in test_cbrt_D()
137 .cbrt(Double.NEGATIVE_INFINITY)); in test_cbrt_D()
138 assertEquals(Double.doubleToLongBits(0.0), Double in test_cbrt_D()
140 assertEquals(Double.doubleToLongBits(+0.0), Double in test_cbrt_D()
142 assertEquals(Double.doubleToLongBits(-0.0), Double in test_cbrt_D()
149 5.643803094122362E102, StrictMath.cbrt(Double.MAX_VALUE)); in test_cbrt_D()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DDoubleTest.java24 assertEquals("0.008", Double.toString(0.008)); in testDoubleToStringUnsignedDivide()
25 assertEquals("0.008366", Double.toString(0.008366)); in testDoubleToStringUnsignedDivide()
27 assertEquals("0.009", Double.toString(0.009)); in testDoubleToStringUnsignedDivide()
29 assertEquals("0.008567856012638986", Double.toString(0.008567856012638986)); in testDoubleToStringUnsignedDivide()
30 assertEquals("0.010206713752229896", Double.toString(0.010206713752229896)); in testDoubleToStringUnsignedDivide()
34 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()
38 Double.parseDouble("NNaN"); in testNamedDoubles()
43 Double.parseDouble("NaNN"); in testNamedDoubles()
[all …]
DOldDoubleTest.java24 Double d = Double.valueOf(Byte.MAX_VALUE); in test_byteValue()
26 d= Double.valueOf(Byte.MIN_VALUE); in test_byteValue()
28 d= Double.valueOf(Double.MAX_VALUE); in test_byteValue()
33 assertEquals(0x7ff8000000000000L, Double.doubleToLongBits(Double.NaN)); in test_doubleToLongBitsD()
34 assertEquals(0x7ff0000000000000L, Double.doubleToLongBits(Double.POSITIVE_INFINITY)); in test_doubleToLongBitsD()
35 assertEquals(0xfff0000000000000L, Double.doubleToLongBits(Double.NEGATIVE_INFINITY)); in test_doubleToLongBitsD()
39 assertEquals(0x7ff8000000000000L, Double.doubleToLongBits(Double.NaN)); in test_doubleToRawLongBitsD()
40 assertEquals(0x7ff0000000000000L, Double.doubleToLongBits(Double.POSITIVE_INFINITY)); in test_doubleToRawLongBitsD()
41 assertEquals(0xfff0000000000000L, Double.doubleToLongBits(Double.NEGATIVE_INFINITY)); in test_doubleToRawLongBitsD()
45 assertEquals(Double.POSITIVE_INFINITY, new Double("1.7976931348623159E308").doubleValue()); in test_doubleValue()
[all …]
DOldAndroidStrictMathTest.java95 assertTrue("Should return Double.NaN", Double.isNaN(StrictMath in testCbrtD()
96 .cbrt(Double.NaN))); in testCbrtD()
98 Double.POSITIVE_INFINITY, StrictMath in testCbrtD()
99 .cbrt(Double.POSITIVE_INFINITY)); in testCbrtD()
101 Double.NEGATIVE_INFINITY, StrictMath in testCbrtD()
102 .cbrt(Double.NEGATIVE_INFINITY)); in testCbrtD()
103 assertEquals(Double.doubleToLongBits(0.0), Double in testCbrtD()
105 assertEquals(Double.doubleToLongBits(+0.0), Double in testCbrtD()
107 assertEquals(Double.doubleToLongBits(-0.0), Double in testCbrtD()
114 5.643803094122362E102, StrictMath.cbrt(Double.MAX_VALUE)); in testCbrtD()
[all …]
DOldAndroidMathTest.java86 long lr = Double.doubleToLongBits(r); in testAcosD()
87 long t = Double.doubleToLongBits(ADJ / HYP); in testAcosD()
95 long lr = Double.doubleToLongBits(r); in testAsinD()
96 long t = Double.doubleToLongBits(OPP / HYP); in testAsinD()
109 assertEquals("wrong atan(+INF)", PI / 2, Math.atan(Double.POSITIVE_INFINITY), 0); in testAtanD()
110 assertEquals("wrong atan(-INF)", -PI / 2, Math.atan(Double.NEGATIVE_INFINITY), 0); in testAtanD()
155 assertTrue("Should return Double.NaN", Double.isNaN(Math in testCbrtD()
156 .cbrt(Double.NaN))); in testCbrtD()
158 Double.POSITIVE_INFINITY, Math in testCbrtD()
159 .cbrt(Double.POSITIVE_INFINITY), 0D); in testCbrtD()
[all …]
DOldAndroidFloatDoubleTest.java27 Double d = Double.valueOf(1.0); in testFloatDouble()
98 double pzero = 1.0 / Double.POSITIVE_INFINITY; in testDouble()
99 double nzero = 1.0 / Double.NEGATIVE_INFINITY; in testDouble()
123 assertEquals(Double.valueOf(pz), Double.valueOf(pz)); in testDouble()
124 assertTrue(!Double.valueOf(pz).equals(Double.valueOf(nz))); in testDouble()
125 assertEquals(Double.valueOf(pz), Double.valueOf(pzero)); in testDouble()
126 assertTrue(!Double.valueOf(pz).equals(Double.valueOf(nzero))); in testDouble()
128 assertTrue(!Double.valueOf(nz).equals(Double.valueOf(pz))); in testDouble()
129 assertEquals(Double.valueOf(nz), Double.valueOf(nz)); in testDouble()
130 assertTrue(!Double.valueOf(nz).equals(Double.valueOf(pzero))); in testDouble()
[all …]
/libcore/ojluni/src/test/java/lang/Math/
DIeeeRecommendedTests.java48 static final double NaNd = Double.NaN;
50 static final double infinityD = Double.POSITIVE_INFINITY;
67 return Double.longBitsToDouble((((long) n + (long) Double.MAX_EXPONENT) << in powerOfTwoD()
233 +Double.MIN_VALUE, in testDoubleGetExponent()
235 +Double.MIN_NORMAL, in testDoubleGetExponent()
236 +Double.MAX_VALUE in testDoubleGetExponent()
239 int[] specialResults = {Double.MAX_EXPONENT + 1, // NaN results in testDoubleGetExponent()
240 Double.MAX_EXPONENT + 1, // Infinite results in testDoubleGetExponent()
241 Double.MIN_EXPONENT - 1, // Zero results in testDoubleGetExponent()
245 Double.MIN_EXPONENT - 1, in testDoubleGetExponent()
[all …]
DHyperbolicTests.java42 static final double NaNd = Double.NaN;
245 {Double.longBitsToDouble(0x7FF0000000000001L), NaNd}, in testSinh()
246 {Double.longBitsToDouble(0xFFF0000000000001L), NaNd}, in testSinh()
247 {Double.longBitsToDouble(0x7FF8555555555555L), NaNd}, in testSinh()
248 {Double.longBitsToDouble(0xFFF8555555555555L), NaNd}, in testSinh()
249 {Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL), NaNd}, in testSinh()
250 {Double.longBitsToDouble(0xFFFFFFFFFFFFFFFFL), NaNd}, in testSinh()
251 {Double.longBitsToDouble(0x7FFDeadBeef00000L), NaNd}, in testSinh()
252 {Double.longBitsToDouble(0xFFFDeadBeef00000L), NaNd}, in testSinh()
253 {Double.longBitsToDouble(0x7FFCafeBabe00000L), NaNd}, in testSinh()
[all …]
DLog10Tests.java40 static final double infinityD = Double.POSITIVE_INFINITY;
41 static final double NaNd = Double.NaN;
58 {Double.NaN, NaNd}, in testLog10()
59 {Double.longBitsToDouble(0x7FF0000000000001L), NaNd}, in testLog10()
60 {Double.longBitsToDouble(0xFFF0000000000001L), NaNd}, in testLog10()
61 {Double.longBitsToDouble(0x7FF8555555555555L), NaNd}, in testLog10()
62 {Double.longBitsToDouble(0xFFF8555555555555L), NaNd}, in testLog10()
63 {Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL), NaNd}, in testLog10()
64 {Double.longBitsToDouble(0xFFFFFFFFFFFFFFFFL), NaNd}, in testLog10()
65 {Double.longBitsToDouble(0x7FFDeadBeef00000L), NaNd}, in testLog10()
[all …]
DPowTests.java40 static final double infinityD = Double.POSITIVE_INFINITY;
56 } else if (input1 == -1.0 && Double.isInfinite(input2)) { in testPowCase()
98 Double.NEGATIVE_INFINITY, in testCrossProduct()
99 /* > -oo */ -Double.MAX_VALUE, in testCrossProduct()
128 /* < 0.0 */ -Double.MIN_VALUE, in testCrossProduct()
131 /* > 0.0 */ +Double.MIN_VALUE, in testCrossProduct()
160 /* < oo */ Double.MAX_VALUE, in testCrossProduct()
161 Double.POSITIVE_INFINITY, in testCrossProduct()
162 Double.NaN in testCrossProduct()
165 double NaN = Double.NaN; in testCrossProduct()
[all …]
DCubeRootTests.java46 static final double infinityD = Double.POSITIVE_INFINITY;
47 static final double NaNd = Double.NaN;
70 {Double.longBitsToDouble(0x7FF0000000000001L), NaNd}, in testCubeRoot()
71 {Double.longBitsToDouble(0xFFF0000000000001L), NaNd}, in testCubeRoot()
72 {Double.longBitsToDouble(0x7FF8555555555555L), NaNd}, in testCubeRoot()
73 {Double.longBitsToDouble(0xFFF8555555555555L), NaNd}, in testCubeRoot()
74 {Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL), NaNd}, in testCubeRoot()
75 {Double.longBitsToDouble(0xFFFFFFFFFFFFFFFFL), NaNd}, in testCubeRoot()
76 {Double.longBitsToDouble(0x7FFDeadBeef00000L), NaNd}, in testCubeRoot()
77 {Double.longBitsToDouble(0xFFFDeadBeef00000L), NaNd}, in testCubeRoot()
[all …]
DRint.java50 {Double.MIN_VALUE, 0.0}, in testRint()
51 {Math.nextDown(Double.MIN_NORMAL), 0.0}, in testRint()
52 {Double.MIN_NORMAL, 0.0}, in testRint()
93 {Double.MAX_VALUE, Double.MAX_VALUE}, in testRint()
94 {Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY}, in testRint()
95 {Double.NaN, Double.NaN} in testRint()
104 for (double d = Double.MIN_VALUE; in testRint()
105 d < Double.POSITIVE_INFINITY; d *= 2) { in testRint()
DClamp.java136 {Double.MIN_VALUE, 0.0, 0.5, Double.MIN_VALUE}, in testDoubleClamp()
143 {Double.MAX_VALUE, 0.0, Double.POSITIVE_INFINITY, Double.MAX_VALUE}, in testDoubleClamp()
144 {Double.POSITIVE_INFINITY, 0.0, Double.MAX_VALUE, Double.MAX_VALUE}, in testDoubleClamp()
145 {-Double.MAX_VALUE, Double.NEGATIVE_INFINITY, 0.0, -Double.MAX_VALUE}, in testDoubleClamp()
146 {Double.NEGATIVE_INFINITY, -Double.MAX_VALUE, 0.0, -Double.MAX_VALUE}, in testDoubleClamp()
161 {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()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DConcurrentModTest.java36 Double one = Double.valueOf(1.0); in testGet()
37 Double two = Double.valueOf(2.0); in testGet()
38 Double three = Double.valueOf(3.0); in testGet()
39 Double four = Double.valueOf(4.0); in testGet()
47 assertTrue(((Double) sub.get(1)).doubleValue() <= 3.0); in testGet()
48 assertTrue(((Double) sub.get(1)).doubleValue() > 2.0); in testGet()
80 Double one = Double.valueOf(1.0); in testSet()
81 Double two = Double.valueOf(2.0); in testSet()
82 Double three = Double.valueOf(3.0); in testSet()
83 Double four = Double.valueOf(4.0); in testSet()
[all …]
/libcore/ojluni/src/test/java/lang/StrictMath/
DExpTests.java55 static final double EXP_OVERFLOW_THRESH = Double.longBitsToDouble(0x4086_2E42_FEFA_39EFL);
59 static final double EXP_UNDERFLOW_THRESH = Double.longBitsToDouble(0xc087_4910_D52D_3051L);
65 {Double.NaN, Double.NaN}, in testExp()
66 {Double.MAX_VALUE, Double.POSITIVE_INFINITY}, in testExp()
67 {Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY}, in testExp()
68 {Double.NEGATIVE_INFINITY, +0.0}, in testExp()
70 {Math.nextUp(EXP_OVERFLOW_THRESH), Double.POSITIVE_INFINITY}, in testExp()
72 {EXP_UNDERFLOW_THRESH, +Double.MIN_VALUE}, in testExp()
101 Double.longBitsToDouble(0x4086_2E42_0000_0000L - 512L), in testAgainstTranslit()
102 Double.longBitsToDouble(0x3fd6_2e42_0000_0000L - 512L), in testAgainstTranslit()
[all …]
DTests.java39 Assert.assertEquals(Double.compare(expected, result), 0, in test()
41 "\tFor input " + input + "\t(" + Double.toHexString(input) + ")\n" + in test()
42 "\texpected " + expected + "\t(" + Double.toHexString(expected) + ")\n" + in test()
43 "\tgot " + result + "\t(" + Double.toHexString(result) + ")."); in test()
48 Assert.assertEquals(Double.compare(expected, result), 0, in test()
50 "\tFor input " + input1 + "\t(" + Double.toHexString(input1) + "), " + in test()
51 +input2 + "\t(" + Double.toHexString(input2) + ")\n" + in test()
52 "\texpected " + expected + "\t(" + Double.toHexString(expected) + ")\n" + in test()
53 "\tgot " + result + "\t(" + Double.toHexString(result) + ")."); in test()
62 final int EXPONENT_RANGE = Double.MAX_EXPONENT - Double.MIN_EXPONENT + 1; in createRandomDouble()
[all …]
/libcore/ojluni/src/main/java/java/lang/
DDouble.java158 public final class Double extends Number class
159 implements Comparable<Double>, Constable, ConstantDesc {
258 public static final Class<Double> TYPE = (Class<Double>) Class.getPrimitiveClass("double");
412 return Double.toString(d); in toHexString()
427 boolean subnormal = (d < Double.MIN_NORMAL); in toHexString()
432 long signifBits = (Double.doubleToLongBits(d) in toHexString()
455 Double.MIN_EXPONENT: in toHexString()
624 public static Double valueOf(String s) throws NumberFormatException { in valueOf()
625 return new Double(parseDouble(s)); in valueOf()
642 public static Double valueOf(double d) { in valueOf()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DDoubleSummaryStatisticsTest.java35 assertEquals(Double.POSITIVE_INFINITY, dss.getMin()); in test_empty()
36 assertEquals(Double.NEGATIVE_INFINITY, dss.getMax()); in test_empty()
69 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()
[all …]
/libcore/luni/src/test/java/libcore/java/util/function/
DFunctionTest.java32 Function<Double, Double> plusOne = x -> x + 1.0d; in testCompose()
33 Function<Double, Double> twice = x -> 2 *x; in testCompose()
38 Function<Double, Double> plusOne = x -> x + 1.0d; in testCompose_null()
46 Function<Double, Double> plusOne = x -> x + 1.0d; in testAndThen()
47 Function<Double, Double> twice = x -> 2 *x; in testAndThen()
52 Function<Double, Double> plusOne = x -> x + 1.0d; in testAndThen_null()
/libcore/ojluni/src/test/java/lang/Double/
DParseHexFloatingPointTest.java34 package test.java.lang.Double;
44 public static final double infinityD = Double.POSITIVE_INFINITY;
45 public static final double NaND = Double.NaN;
49 Assert.assertEquals(Double.compare(result, expected), 0, in test()
86 double result = Double.parseDouble(s5); in testCase()
155 2*Double.MAX_EXPONENT, in testDouble()
156 2*Double.MIN_EXPONENT, in testDouble()
218 new PairSD("0x1.1p-1075", Double.MIN_VALUE), in testDouble()
219 new PairSD("0x1.000000000001p-1075", Double.MIN_VALUE), in testDouble()
220 new PairSD("0x1.000000000000001p-1075", Double.MIN_VALUE), in testDouble()
[all …]
DConstantsTest.java31 package test.java.lang.Double;
44 case (int)Double.NaN: // 0 in testPublicStaticFinalFields_areConstantExpressions()
47 case (int)Double.MIN_VALUE + 1: // 0 + 1 in testPublicStaticFinalFields_areConstantExpressions()
50 case (int)Double.MIN_NORMAL + 2: // 0 + 2 in testPublicStaticFinalFields_areConstantExpressions()
53 case Double.MIN_EXPONENT: // -1022 in testPublicStaticFinalFields_areConstantExpressions()
56 case Double.MAX_EXPONENT: // 1023 in testPublicStaticFinalFields_areConstantExpressions()
59 case (int)Double.MAX_VALUE - 1: // Integer.MAX_VALUE - 1 in testPublicStaticFinalFields_areConstantExpressions()
62 case (int)Double.POSITIVE_INFINITY: // Integer.MAX_VALUE in testPublicStaticFinalFields_areConstantExpressions()
65 case (int)Double.NEGATIVE_INFINITY: // Integer.MIN_VALUE in testPublicStaticFinalFields_areConstantExpressions()
DParseDoubleTest.java29 package test.java.lang.Double;
48 double n = Double.parseDouble(val); in check()
66 if (!Double.isNaN(n)) { in check()
71 if (Double.isNaN(n)) { in check()
77 if (na != Double.POSITIVE_INFINITY) { in check()
105 if (Double.isInfinite(na)) { in check()
106 …l = new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Math.ulp(Double.MAX_VALUE)).multiply(HALF)… in check()
114 if ((Double.doubleToLongBits(n) & 1) != 0) { in check()
126 double n = Double.parseDouble(val); in check()
134 check(new String(""+Double.MIN_VALUE), Double.MIN_VALUE); in rudimentaryTest()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DDoublePipeline.java57 extends AbstractPipeline<E_IN, Double, DoubleStream>
67 DoublePipeline(Supplier<? extends Spliterator<Double>> source, in DoublePipeline()
79 DoublePipeline(Spliterator<Double> source, in DoublePipeline()
99 private static DoubleConsumer adapt(Sink<Double> sink) { in adapt()
117 private static Spliterator.OfDouble adapt(Spliterator<Double> s) { in adapt()
139 public final <P_IN> Node<Double> evaluateToNode(PipelineHelper<Double> helper, in evaluateToNode()
142 IntFunction<Double[]> generator) { in evaluateToNode()
148 public final <P_IN> Spliterator<Double> wrap(PipelineHelper<Double> ph, in wrap()
157 …public final Spliterator.OfDouble lazySpliterator(Supplier<? extends Spliterator<Double>> supplier… in lazySpliterator()
163 public final boolean forEachWithCancel(Spliterator<Double> spliterator, Sink<Double> sink) { in forEachWithCancel()
[all …]

12345678910>>...13