/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
D | FloatTest.java | 90 float result = Float.parseFloat(originalFloatString); in doTestCompareRawBits() 91 rawBits = Float.floatToIntBits(result); in doTestCompareRawBits() 103 Float f = new Float(900.89f); in test_ConstructorF() 113 Float f = new Float("900.89"); in test_ConstructorLjava_lang_String() 122 Float f = new Float(0.46874f); in test_byteValue() 123 Float f2 = new Float(90.8f); in test_byteValue() 132 float[] values = new float[] { Float.NEGATIVE_INFINITY, -Float.MAX_VALUE, -2f, in test_compare() 133 -Float.MIN_VALUE, -0f, 0f, Float.MIN_VALUE, 2f, Float.MAX_VALUE, in test_compare() 134 Float.POSITIVE_INFINITY, Float.NaN }; in test_compare() 137 assertTrue("compare() should be equal: " + f1, Float.compare(f1, f1) == 0); in test_compare() [all …]
|
D | MathTest.java | 228 Float.POSITIVE_INFINITY, Float.MAX_VALUE, 3.4E12f, 2.3f, 229 Float.MIN_NORMAL, Float.MIN_NORMAL / 2, Float.MIN_VALUE, +0.0f, 230 0.0f, -0.0f, -Float.MIN_VALUE, -Float.MIN_NORMAL / 2, 231 -Float.MIN_NORMAL, -4.5f, -5.6442E21f, -Float.MAX_VALUE, 232 Float.NEGATIVE_INFINITY }; 242 final int absMagnitudeBits = Float.floatToIntBits(Math in test_copySign_FF() 244 final int negMagnitudeBits = Float.floatToIntBits(-Math in test_copySign_FF() 249 absMagnitudeBits, Float.floatToIntBits(Math.copySign( in test_copySign_FF() 250 magnitude, Float.NaN))); in test_copySign_FF() 251 assertTrue("The result should be NaN.", Float.isNaN(Math.copySign( in test_copySign_FF() [all …]
|
D | StrictMathTest.java | 251 final int absMagnitudeBits = Float.floatToIntBits(StrictMath in test_copySign_FF() 253 final int negMagnitudeBits = Float.floatToIntBits(-StrictMath in test_copySign_FF() 258 absMagnitudeBits, Float.floatToIntBits(StrictMath.copySign( in test_copySign_FF() 259 magnitude, Float.NaN))); in test_copySign_FF() 260 assertTrue("The result should be NaN.", Float.isNaN(StrictMath in test_copySign_FF() 261 .copySign(Float.NaN, magnitude))); in test_copySign_FF() 265 final int resultBits = Float.floatToIntBits(StrictMath in test_copySign_FF() 267 if (sign > 0 || Float.valueOf(+0.0f).equals(sign) in test_copySign_FF() 268 || Float.valueOf(0.0f).equals(sign)) { in test_copySign_FF() 273 if (sign < 0 || Float.valueOf(-0.0f).equals(sign)) { in test_copySign_FF() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | OldFloatTest.java | 25 new Float("900.89ff"); in test_ConstructorLjava_lang_String() 33 Float f = new Float(Double.MAX_VALUE); in test_ConstructorD() 34 assertTrue("Created incorrect float", f.floatValue() == Float.POSITIVE_INFINITY); in test_ConstructorD() 42 Float.parseFloat(incorrectStrings[i]); in test_parseFloatLExceptions() 52 assertEquals(0x7f800000, Float.floatToIntBits(Float.POSITIVE_INFINITY)); in test_floatToIntBitsF() 53 assertEquals(0xff800000, Float.floatToIntBits(Float.NEGATIVE_INFINITY)); in test_floatToIntBitsF() 54 assertEquals(0x7fc00000, Float.floatToIntBits(Float.NaN)); in test_floatToIntBitsF() 58 assertEquals(0x7f800000, Float.floatToRawIntBits(Float.POSITIVE_INFINITY)); in test_floatToRawIntBitsF() 59 assertEquals(0xff800000, Float.floatToRawIntBits(Float.NEGATIVE_INFINITY)); in test_floatToRawIntBitsF() 60 assertEquals(0x7fc00000, Float.floatToRawIntBits(Float.NaN)); in test_floatToRawIntBitsF() [all …]
|
D | FloatTest.java | 26 assertEquals(2358.166016f, Float.valueOf("2358.166016")); in test_valueOf_String1() 32 assertEquals(-2.14748365E9f, Float.valueOf(String.valueOf(Integer.MIN_VALUE))); in test_valueOf_String2() 36 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() 40 Float.parseFloat("NNaN"); in testNamedFloats() 45 Float.parseFloat("NaNN"); in testNamedFloats() 50 assertEquals(Float.POSITIVE_INFINITY, Float.parseFloat("+Infinity")); in testNamedFloats() 51 assertEquals(Float.POSITIVE_INFINITY, Float.parseFloat("Infinity")); in testNamedFloats() 52 assertEquals(Float.NEGATIVE_INFINITY, Float.parseFloat("-Infinity")); in testNamedFloats() [all …]
|
D | OldAndroidFloatDoubleTest.java | 28 Float f = Float.valueOf(1.0f); in testFloatDouble() 43 float pzero = 1.0f / Float.POSITIVE_INFINITY; in testFloat() 44 float nzero = 1.0f / Float.NEGATIVE_INFINITY; in testFloat() 68 assertEquals(Float.valueOf(pz), Float.valueOf(pz)); in testFloat() 69 assertTrue(!Float.valueOf(pz).equals(Float.valueOf(nz))); in testFloat() 70 assertEquals(Float.valueOf(pz), Float.valueOf(pzero)); in testFloat() 71 assertTrue(!Float.valueOf(pz).equals(Float.valueOf(nzero))); in testFloat() 73 assertTrue(!Float.valueOf(nz).equals(Float.valueOf(pz))); in testFloat() 74 assertEquals(Float.valueOf(nz), Float.valueOf(nz)); in testFloat() 75 assertTrue(!Float.valueOf(nz).equals(Float.valueOf(pzero))); in testFloat() [all …]
|
D | OldAndroidStrictMathTest.java | 481 assertTrue(Float.isNaN(StrictMath.signum(Float.NaN))); in testSignumF() 482 assertEquals(Float.floatToIntBits(0.0f), Float in testSignumF() 484 assertEquals(Float.floatToIntBits(+0.0f), Float in testSignumF() 486 assertEquals(Float.floatToIntBits(-0.0f), Float in testSignumF() 494 assertEquals(1.0f, StrictMath.signum(Float.MAX_VALUE), 0f); in testSignumF() 495 assertEquals(1.0f, StrictMath.signum(Float.MIN_VALUE), 0f); in testSignumF() 496 assertEquals(-1.0f, StrictMath.signum(-Float.MAX_VALUE), 0f); in testSignumF() 497 assertEquals(-1.0f, StrictMath.signum(-Float.MIN_VALUE), 0f); in testSignumF() 498 assertEquals(1.0f, StrictMath.signum(Float.POSITIVE_INFINITY), 0f); in testSignumF() 499 assertEquals(-1.0f, StrictMath.signum(Float.NEGATIVE_INFINITY), 0f); in testSignumF() [all …]
|
D | OldAndroidMathTest.java | 504 assertTrue(Float.isNaN(Math.signum(Float.NaN))); in testSignumF() 505 assertEquals(Float.floatToIntBits(0.0f), Float in testSignumF() 507 assertEquals(Float.floatToIntBits(+0.0f), Float in testSignumF() 509 assertEquals(Float.floatToIntBits(-0.0f), Float in testSignumF() 517 assertEquals(1.0f, Math.signum(Float.MAX_VALUE), 0f); in testSignumF() 518 assertEquals(1.0f, Math.signum(Float.MIN_VALUE), 0f); in testSignumF() 519 assertEquals(-1.0f, Math.signum(-Float.MAX_VALUE), 0f); in testSignumF() 520 assertEquals(-1.0f, Math.signum(-Float.MIN_VALUE), 0f); in testSignumF() 521 assertEquals(1.0f, Math.signum(Float.POSITIVE_INFINITY), 0f); in testSignumF() 522 assertEquals(-1.0f, Math.signum(Float.NEGATIVE_INFINITY), 0f); in testSignumF() [all …]
|
D | IntrinsicTest.java | 118 Float.floatToIntBits(0.0f); in testFloat_floatToIntBits() 119 Float.class.getMethod("floatToIntBits", float.class).invoke(null, 0.0f); in testFloat_floatToIntBits() 123 Float.floatToRawIntBits(0.0f); in testFloat_floatToRawIntBits() 124 Float.class.getMethod("floatToRawIntBits", float.class).invoke(null, 0.0f); in testFloat_floatToRawIntBits() 128 Float.intBitsToFloat(0); in testFloat_intBitsToFloat() 129 Float.class.getMethod("intBitsToFloat", int.class).invoke(null, 0); in testFloat_intBitsToFloat()
|
D | OldDoubleTest.java | 52 assertEquals(Float.POSITIVE_INFINITY, new Double("3.4028236E38").floatValue()); in test_floatValue() 53 assertEquals(Float.NEGATIVE_INFINITY, new Double("-3.4028236E38").floatValue()); in test_floatValue() 54 assertEquals(Float.MAX_VALUE, new Double("3.4028235E38").floatValue()); in test_floatValue() 55 assertEquals(Float.MIN_VALUE, new Double("1.4E-45").floatValue()); in test_floatValue()
|
/libcore/ojluni/src/main/java/java/awt/font/ |
D | TextAttribute.java | 364 public static final Float WEIGHT_EXTRA_LIGHT = 365 Float.valueOf(0.5f); 371 public static final Float WEIGHT_LIGHT = 372 Float.valueOf(0.75f); 379 public static final Float WEIGHT_DEMILIGHT = 380 Float.valueOf(0.875f); 386 public static final Float WEIGHT_REGULAR = 387 Float.valueOf(1.0f); 393 public static final Float WEIGHT_SEMIBOLD = 394 Float.valueOf(1.25f); [all …]
|
/libcore/ojluni/src/main/java/java/lang/ |
D | Float.java | 50 public final class Float extends Number implements Comparable<Float> { class 138 public static final Class<Float> TYPE = (Class<Float>) float[].class.getComponentType(); 416 public static Float valueOf(String s) throws NumberFormatException { in valueOf() 417 return new Float(parseFloat(s)); in valueOf() 433 public static Float valueOf(float f) { in valueOf() 434 return new Float(f); in valueOf() 507 public Float(float value) { in Float() method in Float 517 public Float(double value) { in Float() method in Float 532 public Float(String s) throws NumberFormatException { in Float() method in Float 569 return Float.toString(value); in toString() [all …]
|
D | Math.java | 649 int intBits = Float.floatToRawIntBits(a); in round() 1227 return Float.intBitsToFloat(0x7fffffff & Float.floatToRawIntBits(a)); in abs() 1281 private static long negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f); 1303 (Float.floatToRawIntBits(a) == negativeZeroFloatBits)) { in max() 1383 (Float.floatToRawIntBits(b) == negativeZeroFloatBits)) { in min() 1512 return Float.intBitsToFloat(1 << in ulp() 1557 return (f == 0.0f || Float.isNaN(f))?f:copySign(1.0f, f); in signum() 1794 return Float.intBitsToFloat((Float.floatToRawIntBits(sign) & in copySign() 1796 (Float.floatToRawIntBits(magnitude) & in copySign() 1821 return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >> in getExponent() [all …]
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | RealToStringBenchmark.java | 27 Float.toString(Float.NaN); in timeFloat_toString_NaN() 33 Float.toString(Float.NEGATIVE_INFINITY); in timeFloat_toString_NEGATIVE_INFINITY() 39 Float.toString(Float.POSITIVE_INFINITY); in timeFloat_toString_POSITIVE_INFINITY() 45 Float.toString(0.0f); in timeFloat_toString_zero() 51 Float.toString(-0.0f); in timeFloat_toString_minusZero() 57 Float.toString(SMALL); in timeFloat_toString_small() 63 Float.toString(MEDIUM); in timeFloat_toString_medium() 69 Float.toString(LARGE); in timeFloat_toString_large()
|
D | FloatBenchmark.java | 26 result = Float.floatToIntBits(f); in timeFloatToIntBits() 36 result = Float.floatToRawIntBits(f); in timeFloatToRawIntBits() 46 result = Float.intBitsToFloat(i); in timeIntBitsToFloat() 49 … throw new RuntimeException(Float.toString(result) + " " + Float.floatToRawIntBits(result)); in timeIntBitsToFloat()
|
D | FormatterBenchmark.java | 84 Float value = Float.valueOf(10.24f); // We're not trying to benchmark boxing here. in timeFormatter_OneFloat() 92 Float value = Float.valueOf(10.24f); // We're not trying to benchmark boxing here. in timeFormatter_OneFloat_dot2f() 100 Float value = Float.valueOf(10.24f); // We're not trying to benchmark boxing here. in timeFormatter_TwoFloats()
|
/libcore/ojluni/src/main/java/sun/misc/ |
D | FloatConsts.java | 41 public static final float POSITIVE_INFINITY = java.lang.Float.POSITIVE_INFINITY; 42 public static final float NEGATIVE_INFINITY = java.lang.Float.NEGATIVE_INFINITY; 43 public static final float NaN = java.lang.Float.NaN; 44 public static final float MAX_VALUE = java.lang.Float.MAX_VALUE; 45 public static final float MIN_VALUE = java.lang.Float.MIN_VALUE;
|
D | FpUtils.java | 160 return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >> in getExponent() 179 return Float.intBitsToFloat(((n + FloatConsts.EXP_BIAS) << in powerOfTwoF() 223 return Float.intBitsToFloat((Float.floatToRawIntBits(sign) & in rawCopySign() 225 (Float.floatToRawIntBits(magnitude) & in rawCopySign() 287 return Float.isInfinite(f); in isInfinite() 319 return Float.isNaN(f); in isNaN() 457 int transducer = Float.floatToRawIntBits(f); in ilogb() 855 int transducer = Float.floatToRawIntBits(start + 0.0f); in nextAfter() 890 return Float.intBitsToFloat(transducer); in nextAfter() 959 return Float.intBitsToFloat(Float.floatToRawIntBits(f) + in nextUp() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | Arrays2Test.java | 58 float[] specials = new float[] { Float.NEGATIVE_INFINITY, in test_binarySearch$FF() 59 -Float.MAX_VALUE, -2f, -Float.MIN_VALUE, -0f, 0f, in test_binarySearch$FF() 60 Float.MIN_VALUE, 2f, Float.MAX_VALUE, Float.POSITIVE_INFINITY, in test_binarySearch$FF() 61 Float.NaN }; in test_binarySearch$FF() 103 Arrays.fill(d, Float.MAX_VALUE); in test_equals$F$F() 104 Arrays.fill(x, Float.MIN_VALUE); in test_equals$F$F() 108 Arrays.fill(x, Float.MAX_VALUE); in test_equals$F$F() 112 Arrays.equals(new float[] { Float.NaN }, new float[] { Float.NaN })); in test_equals$F$F() 169 …float[] specials1 = new float[] { Float.NaN, Float.MAX_VALUE, Float.MIN_VALUE, 0f, -0f, Float.POSI… in test_sort$F() 170 …] specials2 = new float[] { 0f, Float.POSITIVE_INFINITY, -0f, Float.NEGATIVE_INFINITY, Float.MIN_V… in test_sort$F() [all …]
|
D | FormatterTest.java | 1152 { new Float(1.1f), "%3.2b", " tr", }, in test_format_LString$LObject_GeneralConversionB() 1153 { new Float(1.1f), "%-4.6b", "true", }, in test_format_LString$LObject_GeneralConversionB() 1154 { new Float(1.1f), "%.2b", "tr", }, in test_format_LString$LObject_GeneralConversionB() 1216 { new Float(1.1f), "%2.3s", "1.1", }, in test_format_LString$LObject_GeneralConversionS() 1217 { new Float(1.1f), "%-6.4s", "1.1 ", }, in test_format_LString$LObject_GeneralConversionS() 1218 { new Float(1.1f), "%.5s", "1.1", }, in test_format_LString$LObject_GeneralConversionS() 1268 new Float(1.1f), in test_format_LString$LObject_GeneralConversionH() 1311 new Float(1.1f), in test_formatLjava_lang_String$Ljava_lang_Object_GeneralConversionOther() 1406 final Object[] illArgs = { Boolean.TRUE, new Float(1.1f), in test_formatLjava_lang_String$Ljava_lang_Object_CharacterConversion() 1407 new Double(1.1d), "string content", new Float(1.1f), new Date() }; in test_formatLjava_lang_String$Ljava_lang_Object_CharacterConversion() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/invoke/ |
D | MethodHandlesTest.java | 850 MethodHandles.lookup().findConstructor(Float.class, in testConstructors() 853 Float value = (Float) mh.invokeExact(0.33f); in testConstructors() 856 value = (Float) mh.invoke(3.34f); in testConstructors() 895 String.class, MethodType.methodType(String.class, Float.class)); in testConstructors() 1012 Float.class, "valueOf", MethodType.methodType(Float.class, String.class)); in testReferenceReturnValueConversions() 1015 Float f = (Float) mh.invokeExact("1.375"); in testReferenceReturnValueConversions() 1018 f = (Float) mh.invoke("1.875"); in testReferenceReturnValueConversions() 1064 Comparable<Float> c = (Comparable<Float>) mh.invoke("2.125"); in testReferenceReturnValueConversions() 1065 assertEquals(0, c.compareTo(Float.valueOf(2.125f))); in testReferenceReturnValueConversions() 1201 public String update(Float f0, Float... floats) { in update() [all …]
|
/libcore/luni/src/test/java/libcore/java/awt/font/ |
D | TextAttributeTest.java | 36 assertEquals(new Float(0.04f), TextAttribute.TRACKING_LOOSE); in testAttributeValues() 37 assertEquals(new Float(-0.04f), TextAttribute.TRACKING_TIGHT); in testAttributeValues()
|
/libcore/ojluni/src/main/native/ |
D | Float.c | 63 NATIVE_METHOD(Float, intBitsToFloat, "(I)F"), 64 NATIVE_METHOD(Float, floatToRawIntBits, "(F)I"),
|
/libcore/luni/src/test/java/dalvik/system/ |
D | JniTest.java | 297 Float.MAX_VALUE, Float.MIN_VALUE, Float.MIN_NORMAL, Float.NaN, in testPassingFloats() 298 … Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, (float)Math.E, (float)Math.PI, 0, -1}; in testPassingFloats() 328 Float.MAX_VALUE, Float.MIN_VALUE, Float.MIN_NORMAL, Float.NaN, in testPassingDoubles() 329 Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, in testPassingDoubles()
|
/libcore/ojluni/src/main/java/java/nio/ |
D | FloatBuffer.java | 660 return (x == y) || (Float.isNaN(x) && Float.isNaN(y)); in equals() 703 Float.isNaN(x) ? (Float.isNaN(y) ? 0 : +1) : -1); in compare()
|