java.lang.Object | ||
↳ | java.lang.Number | |
↳ | java.lang.Double |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MAX_EXPONENT | Maximum exponent that a finite value of the double type may have. |
|||||||||
double | MAX_VALUE | Constant for the maximum double value, (2 - 2-52) *
21023. |
|||||||||
int | MIN_EXPONENT | Minimum exponent that a normal value of the double type may have. |
|||||||||
double | MIN_NORMAL | Constant for the smallest positive normal value of the double type. |
|||||||||
double | MIN_VALUE | Constant for the minimum double value, 2-1074. |
|||||||||
double | NEGATIVE_INFINITY | Constant for the negative infinity value of the double type. |
|||||||||
double | NaN | Constant for the Not-a-Number (NaN) value of the double type. |
|||||||||
double | POSITIVE_INFINITY | Constant for the positive infinity value of the double type. |
|||||||||
int | SIZE | Constant for the number of bits needed to represent a double in
two's complement form. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TYPE | The Class object that represents the primitive type double . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
Double with the specified primitive double
value. | |||||||||||
Constructs a new
Double from the specified string. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns this object's value as a byte.
| |||||||||||
Compares the two specified double values.
| |||||||||||
Compares this object to the specified double object to determine their
relative order.
| |||||||||||
Converts the specified double value to a binary representation conforming
to the IEEE 754 floating-point double precision bit layout.
| |||||||||||
Converts the specified double value to a binary representation conforming
to the IEEE 754 floating-point double precision bit layout.
| |||||||||||
Gets the primitive value of this double.
| |||||||||||
Tests this double for equality with
object . | |||||||||||
Returns this object's value as a float.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Returns this object's value as an int.
| |||||||||||
Indicates whether the specified double represents an infinite value.
| |||||||||||
Indicates whether this object represents an infinite value.
| |||||||||||
Indicates whether this object is a Not-a-Number (NaN) value.
| |||||||||||
Indicates whether the specified double is a Not-a-Number (NaN)
value.
| |||||||||||
Converts the specified IEEE 754 floating-point double precision bit
pattern to a Java double value.
| |||||||||||
Returns this object's value as a long.
| |||||||||||
Parses the specified string as a double value.
| |||||||||||
Returns this object's value as a short.
| |||||||||||
Converts the specified double into its hexadecimal string representation.
| |||||||||||
Returns a string containing a concise, human-readable description of the
specified double value.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Parses the specified string as a double value.
| |||||||||||
Returns a
Double instance for the specified double value. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Number
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
|
Maximum exponent that a finite value of the double
type may have.
Equal to Math.getExponent(Double.MAX_VALUE)
.
Constant for the maximum double
value, (2 - 2-52) *
21023.
Minimum exponent that a normal value of the double
type may have.
Equal to Math.getExponent(Double.MIN_NORMAL)
.
Constant for the smallest positive normal value of the double
type.
Constant for the minimum double
value, 2-1074.
Constant for the negative infinity value of the double
type.
Constant for the Not-a-Number (NaN) value of the double
type.
Constant for the positive infinity value of the double
type.
Constant for the number of bits needed to represent a double
in
two's complement form.
The Class
object that represents the primitive type double
.
Constructs a new Double
with the specified primitive double
value.
value | the primitive double value to store in the new instance. |
---|
Constructs a new Double
from the specified string.
string | the string representation of a double value. |
---|
NumberFormatException | if string cannot be parsed as a double value. |
---|
Returns this object's value as a byte. Might involve rounding and/or truncating the value, so it fits into a byte.
Compares the two specified double values. There are two special cases:
Double.NaN
is equal to Double.NaN
and it is greater
than any other double value, including Double.POSITIVE_INFINITY
;double1 | the first value to compare. |
---|---|
double2 | the second value to compare. |
double1
is less than double2
;
0 if double1
and double2
are equal; a positive
value if double1
is greater than double2
.
Compares this object to the specified double object to determine their relative order. There are two special cases:
Double.NaN
is equal to Double.NaN
and it is greater
than any other double value, including Double.POSITIVE_INFINITY
;object | the double object to compare this object to. |
---|
object
; 0 if the value of this double and the
value of object
are equal; a positive value if the value
of this double is greater than the value of object
.NullPointerException | if object is null . |
---|
Converts the specified double value to a binary representation conforming
to the IEEE 754 floating-point double precision bit layout. All
Not-a-Number (NaN) values are converted to a single NaN
representation (0x7ff8000000000000L
).
value | the double value to convert. |
---|
value
.Converts the specified double value to a binary representation conforming to the IEEE 754 floating-point double precision bit layout. Not-a-Number (NaN) values are preserved.
value | the double value to convert. |
---|
value
.Gets the primitive value of this double.
Tests this double for equality with object
.
To be equal, object
must be an instance of Double
and
doubleToLongBits
must give the same value for both objects.
Note that, unlike ==
, -0.0
and +0.0
compare
unequal, and NaN
s compare equal by this method.
object | the object to compare this double with. |
---|
true
if the specified object is equal to this
Double
; false
otherwise.
Returns this object's value as a float. Might involve rounding.
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct hashCode
method
if you intend implementing your own hashCode
method.
Returns this object's value as an int. Might involve rounding and/or truncating the value, so it fits into an int.
Indicates whether the specified double represents an infinite value.
d | the double to check. |
---|
true
if the value of d
is positive or negative
infinity; false
otherwise.
Indicates whether this object represents an infinite value.
true
if the value of this double is positive or negative
infinity; false
otherwise.
Indicates whether this object is a Not-a-Number (NaN) value.
true
if this double is Not-a-Number;
false
if it is a (potentially infinite) double number.
Indicates whether the specified double is a Not-a-Number (NaN) value.
d | the double value to check. |
---|
true
if d
is Not-a-Number;
false
if it is a (potentially infinite) double number.
Converts the specified IEEE 754 floating-point double precision bit pattern to a Java double value.
bits | the IEEE 754 floating-point double precision representation of a double value. |
---|
bits
.Returns this object's value as a long. Might involve rounding and/or truncating the value, so it fits into a long.
Parses the specified string as a double value.
string | the string representation of a double value. |
---|
string
.NumberFormatException | if string cannot be parsed as a double value.
|
---|
Returns this object's value as a short. Might involve rounding and/or truncating the value, so it fits into a short.
Converts the specified double into its hexadecimal string representation.
d | the double to convert. |
---|
d
.Returns a string containing a concise, human-readable description of the specified double value.
d | the double to convert to a string. |
---|
d
.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful toString
method
if you intend implementing your own toString
method.
Parses the specified string as a double value.
string | the string representation of a double value. |
---|
Double
instance containing the double value represented
by string
.NumberFormatException | if string cannot be parsed as a double value. |
---|
Returns a Double
instance for the specified double value.
d | the double value to store in the instance. |
---|
Double
instance containing d
.