Home
last modified time | relevance | path

Searched refs:Float (Results 1 – 25 of 109) 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.java676 int intBits = Float.floatToRawIntBits(a); in round()
1378 return Float.intBitsToFloat(0x7fffffff & Float.floatToRawIntBits(a)); in abs()
1434 private static long negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f);
1456 (Float.floatToRawIntBits(a) == negativeZeroFloatBits)) { in max()
1536 (Float.floatToRawIntBits(b) == negativeZeroFloatBits)) { in min()
1665 return Float.intBitsToFloat(1 << in ulp()
1710 return (f == 0.0f || Float.isNaN(f))?f:copySign(1.0f, f); in signum()
1947 return Float.intBitsToFloat((Float.floatToRawIntBits(sign) & in copySign()
1949 (Float.floatToRawIntBits(magnitude) & in copySign()
1974 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/annotations/hiddenapi/java/lang/
DFloat.java32 public final class Float extends java.lang.Number implements java.lang.Comparable<java.lang.Float> { class
34 public Float(float value) { in Float() method in Float
38 public Float(double value) { in Float() method in Float
42 public Float(java.lang.String s) throws java.lang.NumberFormatException { in Float() method in Float
54 public static java.lang.Float valueOf(java.lang.String s) in valueOf()
59 public static java.lang.Float valueOf(float f) { in valueOf()
135 public int compareTo(java.lang.Float anotherFloat) { in compareTo()
175 public static final java.lang.Class<java.lang.Float> TYPE;
/libcore/ojluni/annotations/sdk/nullability/java/lang/
DFloat.annotated.java31 public final class Float extends java.lang.Number implements java.lang.Comparable<java.lang.Float> { class
33 public Float(float value) { throw new RuntimeException("Stub!"); } in Float() method in Float
35 public Float(double value) { throw new RuntimeException("Stub!"); } in Float() method in Float
37 public Float(@libcore.util.NonNull java.lang.String s) throws java.lang.NumberFormatException { thr… in Float() method in Float
43 @libcore.util.NonNull public static java.lang.Float valueOf(@libcore.util.NonNull java.lang.String … in valueOf()
45 @libcore.util.NonNull public static java.lang.Float valueOf(float f) { throw new RuntimeException("… in valueOf()
85 public int compareTo(@libcore.util.NonNull java.lang.Float anotherFloat) { throw new RuntimeExcepti… in compareTo()
115 public static final java.lang.Class<java.lang.Float> TYPE;
/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;
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
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 …]
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 …]
/libcore/luni/src/test/java/libcore/java/lang/invoke/
DMethodHandlesTest.java898 MethodHandles.lookup().findConstructor(Float.class, in testConstructors()
901 Float value = (Float) mh.invokeExact(0.33f); in testConstructors()
904 value = (Float) mh.invoke(3.34f); in testConstructors()
943 String.class, MethodType.methodType(String.class, Float.class)); in testConstructors()
1060 Float.class, "valueOf", MethodType.methodType(Float.class, String.class)); in testReferenceReturnValueConversions()
1063 Float f = (Float) mh.invokeExact("1.375"); in testReferenceReturnValueConversions()
1066 f = (Float) mh.invoke("1.875"); in testReferenceReturnValueConversions()
1112 Comparable<Float> c = (Comparable<Float>) mh.invoke("2.125"); in testReferenceReturnValueConversions()
1113 assertEquals(0, c.compareTo(Float.valueOf(2.125f))); in testReferenceReturnValueConversions()
1249 public String update(Float f0, Float... floats) { in update()
[all …]
DExplicitCastArgumentsTest.java66 private static final Float[] FLOAT_VALUES = new Float[]{
67 Float.valueOf(0.0f), Float.valueOf(0.5f), Float.valueOf(1.0f), Float.valueOf(2.0f),
68 Float.valueOf(3.141f), Float.valueOf(-0.5f), Float.valueOf(-1.0f), Float.valueOf(-2.0f),
69 Float.valueOf(-3.141f), Float.MIN_VALUE, Float.MAX_VALUE
387 MethodHandle mh = explicitCastArgumentToIdentity(Float.class, boolean.class); in explicitCastArgumentZToFloat()
389 Float o = (Float) mh.invokeExact(BOOLEAN_VALUES[0].booleanValue()); in explicitCastArgumentZToFloat()
522 MethodHandle mh = explicitCastArgumentToIdentity(Float.class, byte.class); in explicitCastArgumentBToFloat()
524 Float o = (Float) mh.invokeExact(BYTE_VALUES[0].byteValue()); in explicitCastArgumentBToFloat()
657 MethodHandle mh = explicitCastArgumentToIdentity(Float.class, char.class); in explicitCastArgumentCToFloat()
659 Float o = (Float) mh.invokeExact(CHARACTER_VALUES[0].charValue()); in explicitCastArgumentCToFloat()
[all …]
/libcore/luni/src/test/java/libcore/libcore/reflect/
DParameterizedTypeRegressionTest.java80 Type actual = new ParameterizedClass<List<Map<String, Float>>>() { in testGenericOfGeneric()
90 Float.class) in testGenericOfGeneric()
116 Type actual = new ParameterizedClass<A<Integer>.B<Float>>() { in testNested2()
125 Float.class in testNested2()
136 Type actual = new ParameterizedClass<A<Integer>.B<Float>.C1<String>>() { in testNested3()
146 Float.class), in testNested3()
160 Type actual = new ParameterizedClass<A<Integer>.B<Float>.C1<String>.D1>() { in testNested4_nonGenericLeaf()
171 Float.class), in testNested4_nonGenericLeaf()
186 Type actual = new ParameterizedClass<A<Integer>.B<Float>.C2.D2<String>>() { in testNested4_nonGenericNonLeaf()
197 Float.class), in testNested4_nonGenericNonLeaf()
/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()

12345