public final class Double extends Number implements Comparable<Double>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_EXPONENT |
static double |
MAX_VALUE |
static int |
MIN_EXPONENT |
static double |
MIN_NORMAL |
static double |
MIN_VALUE |
static double |
NaN |
static double |
NEGATIVE_INFINITY |
static double |
POSITIVE_INFINITY |
static int |
SIZE |
static Class<?> |
TYPE |
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Return the byte value of this Number.
|
static int |
compare(double a,
double b) |
int |
compareTo(Double other)
Compares this with another Object.
|
static long |
doubleToLongBits(double value)
Returns the bit representation of a double-float value.
|
static long |
doubleToRawLongBits(double d)
Returns the bit representation of a double-float value.
|
double |
doubleValue()
Return the double value of this Number.
|
boolean |
equals(Object o) |
float |
floatValue()
Return the float value of this Number.
|
int |
hashCode() |
int |
intValue()
Return the int value of this Number.
|
boolean |
isInfinite() |
static boolean |
isInfinite(double v) |
boolean |
isNaN() |
static boolean |
isNaN(double val) |
static double |
longBitsToDouble(long l)
Returns the double-float corresponding to a given bit representation.
|
long |
longValue()
Return the long value of this Number.
|
static double |
parseDouble(String s)
Converts a String value into a double.
|
short |
shortValue()
Return the short value of this Number.
|
String |
toString() |
static String |
toString(double d)
Convert a double to a String
|
static Double |
valueOf(double d) |
static Double |
valueOf(String s) |
public static final int MAX_EXPONENT
public static final double MAX_VALUE
public static final int MIN_EXPONENT
public static final double MIN_NORMAL
public static final double MIN_VALUE
public static final double NaN
public static final double NEGATIVE_INFINITY
public static final double POSITIVE_INFINITY
public static final int SIZE
public static final Class<?> TYPE
public Double(double val)
public Double(String val)
public byte byteValue()
Number
public static int compare(double a, double b)
public int compareTo(Double other)
Comparable
compareTo
in interface Comparable<Double>
other
- the object to compare withpublic static long doubleToLongBits(double value)
doubleToRawLongBits
this
method does collapse all NaN values into a standard single value. This
value is 0x7ff8000000000000
.value
- a floating-point number.public static long doubleToRawLongBits(double d)
0x7ff0000000000000
.
0xfff0000000000000
.
If the argument is NaN, the result is the integer representing the actual NaN value.
longBitsToDouble(long)
method, will produce a floating-point
value equal to the argument to doubleToRawLongBits
.d
- a floating-point number.public double doubleValue()
Number
doubleValue
in class Number
public float floatValue()
Number
floatValue
in class Number
public int intValue()
Number
public boolean isInfinite()
public static boolean isInfinite(double v)
public boolean isNaN()
public static boolean isNaN(double val)
public static double longBitsToDouble(long l)
If the argument is 0x7ff0000000000000
, the result is positive
infinity.
If the argument is 0xfff0000000000000
, the result is negative
infinity.
If the argument is any value in the range 0x7ff0000000000001L through
0x7fffffffffffffffL or in the range 0xfff0000000000001L through
0xffffffffffffffffL, the result is a NaN.
All IEEE 754 NaN values of type float
are, in effect,
lumped together by the Java programming language into a single
double
value called NaN. Distinct values of NaN are only
accessible by use of the Double.doubleToRawLongBits
method.
l
- a long.public long longValue()
Number
public static double parseDouble(String s) throws NumberFormatException
s
- String representation of the floating point numberNumberFormatException
public short shortValue()
Number
shortValue
in class Number
public static String toString(double d)
d
- the double to be convertedpublic static Double valueOf(double d)