Home
last modified time | relevance | path

Searched refs:Float (Results 1 – 25 of 103) sorted by relevance

12345

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DFloatTest.java90 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 …]
DMathTest.java228 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 …]
DStrictMathTest.java251 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/
DFloatTest.java26 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 …]
DOldFloatTest.java25 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 …]
DOldAndroidFloatDoubleTest.java28 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 …]
DOldAndroidStrictMathTest.java481 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 …]
DOldAndroidMathTest.java504 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 …]
DIntrinsicTest.java118 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()
DOldDoubleTest.java52 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/
DTextAttribute.java194 public static final Float WEIGHT_EXTRA_LIGHT =
195 Float.valueOf(0.5f);
201 public static final Float WEIGHT_LIGHT =
202 Float.valueOf(0.75f);
209 public static final Float WEIGHT_DEMILIGHT =
210 Float.valueOf(0.875f);
216 public static final Float WEIGHT_REGULAR =
217 Float.valueOf(1.0f);
223 public static final Float WEIGHT_SEMIBOLD =
224 Float.valueOf(1.25f);
[all …]
/libcore/ojluni/src/main/java/java/lang/
DFloat.java49 public final class Float extends Number implements Comparable<Float> { class
137 public static final Class<Float> TYPE = (Class<Float>) Class.getPrimitiveClass("float");
415 public static Float valueOf(String s) throws NumberFormatException { in valueOf()
416 return new Float(parseFloat(s)); in valueOf()
432 public static Float valueOf(float f) { in valueOf()
433 return new Float(f); in valueOf()
506 public Float(float value) { in Float() method in Float
516 public Float(double value) { in Float() method in Float
531 public Float(String s) throws NumberFormatException { in Float() method in Float
568 return Float.toString(value); in toString()
[all …]
DMath.java652 int intBits = Float.floatToRawIntBits(a); in round()
1236 return Float.intBitsToFloat(0x7fffffff & Float.floatToRawIntBits(a)); in abs()
1292 private static long negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f);
1314 (Float.floatToRawIntBits(a) == negativeZeroFloatBits)) { in max()
1394 (Float.floatToRawIntBits(b) == negativeZeroFloatBits)) { in min()
1523 return Float.intBitsToFloat(1 << in ulp()
1568 return (f == 0.0f || Float.isNaN(f))?f:copySign(1.0f, f); in signum()
1805 return Float.intBitsToFloat((Float.floatToRawIntBits(sign) & in copySign()
1807 (Float.floatToRawIntBits(magnitude) & in copySign()
1832 return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >> in getExponent()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DRealToStringBenchmark.java27 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()
DFloatBenchmark.java26 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()
DFormatterBenchmark.java84 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/
DFloatConsts.java41 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;
DFpUtils.java224 return Float.isFinite(f); in isFinite()
256 return Float.isInfinite(f); in isInfinite()
288 return Float.isNaN(f); in isNaN()
426 int transducer = Float.floatToRawIntBits(f); in ilogb()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DArrays2Test.java58 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 …]
DFormatterTest.java1153 { new Float(1.1f), "%3.2b", " tr", }, in test_format_LString$LObject_GeneralConversionB()
1154 { new Float(1.1f), "%-4.6b", "true", }, in test_format_LString$LObject_GeneralConversionB()
1155 { new Float(1.1f), "%.2b", "tr", }, in test_format_LString$LObject_GeneralConversionB()
1217 { new Float(1.1f), "%2.3s", "1.1", }, in test_format_LString$LObject_GeneralConversionS()
1218 { new Float(1.1f), "%-6.4s", "1.1 ", }, in test_format_LString$LObject_GeneralConversionS()
1219 { new Float(1.1f), "%.5s", "1.1", }, in test_format_LString$LObject_GeneralConversionS()
1269 new Float(1.1f), in test_format_LString$LObject_GeneralConversionH()
1312 new Float(1.1f), in test_formatLjava_lang_String$Ljava_lang_Object_GeneralConversionOther()
1407 final Object[] illArgs = { Boolean.TRUE, new Float(1.1f), in test_formatLjava_lang_String$Ljava_lang_Object_CharacterConversion()
1408 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/
DMethodHandlesTest.java850 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/
DTextAttributeTest.java36 assertEquals(new Float(0.04f), TextAttribute.TRACKING_LOOSE); in testAttributeValues()
37 assertEquals(new Float(-0.04f), TextAttribute.TRACKING_TIGHT); in testAttributeValues()
/libcore/luni/src/test/java/libcore/dalvik/system/
DJniTest.java297 Float.MAX_VALUE, Float.MIN_VALUE, Float.MIN_NORMAL, Float.NaN, in testPassingFloats()
298Float.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/native/
DFloat.c63 NATIVE_METHOD(Float, intBitsToFloat, "(I)F"),
64 NATIVE_METHOD(Float, floatToRawIntBits, "(F)I"),
/libcore/ojluni/src/main/java/java/nio/
DFloatBuffer.java759 return (x == y) || (Float.isNaN(x) && Float.isNaN(y)); in equals()
802 Float.isNaN(x) ? (Float.isNaN(y) ? 0 : +1) : -1); in compare()

12345