Float (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Serializable, Comparable<Float>, Constable, ConstantDesc
-
Field Summary
Fields
static final intThe number of bytes used to represent a
floatvalue, 4.static final intMaximum exponent a finite
floatvariable may have, 127.static final floatA constant holding the largest positive finite value of type
float, (2-2-23)ยท2127.static final intMinimum exponent a normalized
floatvariable may have, -126.static final floatA constant holding the smallest positive normal value of type
float, 2-126.static final floatA constant holding the smallest positive nonzero value of type
float, 2-149.static final floatA constant holding a Not-a-Number (NaN) value of type
float.static final floatA constant holding the negative infinity of type
float.static final floatA constant holding the positive infinity of type
float.static final intThe number of bits in the significand of a
floatvalue, 24.static final intThe number of bits used to represent a
floatvalue, 32.The
Classinstance representing the primitive typefloat. -
Constructor Summary
Constructors
-
Method Summary
byteReturns the value of this
Floatas abyteafter a narrowing primitive conversion.static intcompare(float f1, float f2) Compares the two specified
floatvalues.intCompares two
Floatobjects numerically.Returns an
Optionalcontaining the nominal descriptor for this instance, which is the instance itself.doubleReturns the value of this
Floatas adoubleafter a widening primitive conversion.booleanCompares this object against the specified object.
static floatfloat16ToFloat(short floatBinary16) Returns the
floatvalue closest to the numerical value of the argument, a floating-point binary16 value encoded in ashort.static shortfloatToFloat16(float f) Returns the floating-point binary16 value, encoded in a
short, closest in value to the argument.static intfloatToIntBits(float value) Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout.
static intfloatToRawIntBits(float value) Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout, preserving Not-a-Number (NaN) values.
floatReturns the
floatvalue of thisFloatobject.inthashCode()Returns a hash code for this
Floatobject.static inthashCode(float value) Returns a hash code for a
floatvalue; compatible withFloat.hashCode().static floatintBitsToFloat(int bits) Returns the
floatvalue corresponding to a given bit representation.intintValue()Returns the value of this
Floatas anintafter a narrowing primitive conversion.static booleanisFinite(float f) Returns
trueif the argument is a finite floating-point value; returnsfalseotherwise (for NaN and infinity arguments).booleanReturns
trueif thisFloatvalue is infinitely large in magnitude,falseotherwise.static booleanisInfinite(float v) Returns
trueif the specified number is infinitely large in magnitude,falseotherwise.booleanisNaN()Returns
trueif thisFloatvalue is a Not-a-Number (NaN),falseotherwise.static booleanisNaN(float v) Returns
trueif the specified number is a Not-a-Number (NaN) value,falseotherwise.longReturns value of this
Floatas alongafter a narrowing primitive conversion.static floatmax(float a, float b) Returns the greater of two
floatvalues as if by callingMath.max.static floatmin(float a, float b) Returns the smaller of two
floatvalues as if by callingMath.min.static floatReturns a new
floatinitialized to the value represented by the specifiedString, as performed by thevalueOfmethod of classFloat.Resolves this instance as a
ConstantDesc, the result of which is the instance itself.shortReturns the value of this
Floatas ashortafter a narrowing primitive conversion.static floatsum(float a, float b) Adds two
floatvalues together as per the + operator.toHexString(float f) Returns a hexadecimal string representation of the
floatargument.toString()Returns a string representation of this
Floatobject.toString(float f) Returns a string representation of the
floatargument.valueOf(float f) Returns a
Floatinstance representing the specifiedfloatvalue.Returns a
Floatobject holding thefloatvalue represented by the argument strings.
-
Field Details
-
POSITIVE_INFINITY
-
NEGATIVE_INFINITY
-
NaN
-
MAX_VALUE
-
MIN_NORMAL
-
MIN_VALUE
-
SIZE
-
PRECISION
-
MAX_EXPONENT
-
MIN_EXPONENT
-
BYTES
-
TYPE
-
-
Constructor Details
-
Float
-
Float
-
Float
-
-
Method Details
-
toString
-
toHexString
-
valueOf
-
valueOf
-
parseFloat
-
isNaN
-
isInfinite
-
isFinite
-
isNaN
-
isInfinite
-
toString
-
byteValue
-
shortValue
-
intValue
-
longValue
-
floatValue
-
doubleValue
-
hashCode
-
hashCode
-
equals
-
floatToIntBits
-
floatToRawIntBits
-
intBitsToFloat
-
float16ToFloat
-
floatToFloat16
-
compareTo
-
compare
-
sum
-
max
-
min
-
describeConstable
-
resolveConstantDesc
-