Double (Java SE 23 & JDK 23)
-
Field Summary
Fields
static final intThe number of bytes used to represent a
doublevalue.static final intMaximum exponent a finite
doublevariable may have.static final doubleA constant holding the largest positive finite value of type
double, (2-2-52)ยท21023.static final intMinimum exponent a normalized
doublevariable may have.static final doubleA constant holding the smallest positive normal value of type
double, 2-1022.static final doubleA constant holding the smallest positive nonzero value of type
double, 2-1074.static final doubleA constant holding a Not-a-Number (NaN) value of type
double.static final doubleA constant holding the negative infinity of type
double.static final doubleA constant holding the positive infinity of type
double.static final intThe number of bits in the significand of a
doublevalue.static final intThe number of bits used to represent a
doublevalue.The
Classinstance representing the primitive typedouble. -
Constructor Summary
Constructors
Double(double value) Deprecated, for removal: This API element is subject to removal in a future version.
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
byteReturns the value of this
Doubleas abyteafter a narrowing primitive conversion.static intcompare(double d1, double d2) Compares the two specified
doublevalues.intCompares two
Doubleobjects numerically.Returns an
Optionalcontaining the nominal descriptor for this instance, which is the instance itself.static longdoubleToLongBits(double value) Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout.
static longdoubleToRawLongBits(double value) Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout, preserving Not-a-Number (NaN) values.
doubleReturns the
doublevalue of thisDoubleobject.booleanCompares this object against the specified object.
floatReturns the value of this
Doubleas afloatafter a narrowing primitive conversion.inthashCode()Returns a hash code for this
Doubleobject.static inthashCode(double value) Returns a hash code for a
doublevalue; compatible withDouble.hashCode().intintValue()Returns the value of this
Doubleas anintafter a narrowing primitive conversion.static booleanisFinite(double d) Returns
trueif the argument is a finite floating-point value; returnsfalseotherwise (for NaN and infinity arguments).booleanReturns
trueif thisDoublevalue is infinitely large in magnitude,falseotherwise.static booleanisInfinite(double v) Returns
trueif the specified number is infinitely large in magnitude,falseotherwise.booleanisNaN()Returns
trueif thisDoublevalue is a Not-a-Number (NaN),falseotherwise.static booleanisNaN(double v) Returns
trueif the specified number is a Not-a-Number (NaN) value,falseotherwise.static doublelongBitsToDouble(long bits) Returns the
doublevalue corresponding to a given bit representation.longReturns the value of this
Doubleas alongafter a narrowing primitive conversion.static doublemax(double a, double b) Returns the greater of two
doublevalues as if by callingMath.max.static doublemin(double a, double b) Returns the smaller of two
doublevalues as if by callingMath.min.static doubleReturns a new
doubleinitialized to the value represented by the specifiedString, as performed by thevalueOfmethod of classDouble.Resolves this instance as a
ConstantDesc, the result of which is the instance itself.shortReturns the value of this
Doubleas ashortafter a narrowing primitive conversion.static doublesum(double a, double b) Adds two
doublevalues together as per the + operator.toHexString(double d) Returns a hexadecimal string representation of the
doubleargument.toString()Returns a string representation of this
Doubleobject.toString(double d) Returns a string representation of the
doubleargument.valueOf(double d) Returns a
Doubleinstance representing the specifieddoublevalue.Returns a
Doubleobject holding thedoublevalue 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
-
Double
-
Double
-
-
Method Details
-
toString
-
toHexString
-
valueOf
-
valueOf
-
parseDouble
-
isNaN
-
isInfinite
-
isFinite
-
isNaN
-
isInfinite
-
toString
-
byteValue
-
shortValue
-
intValue
-
longValue
-
floatValue
-
doubleValue
-
hashCode
-
hashCode
-
equals
-
doubleToLongBits
-
doubleToRawLongBits
-
longBitsToDouble
-
compareTo
-
compare
-
sum
-
max
-
min
-
describeConstable
-
resolveConstantDesc
-