Java Reference
In-Depth Information
31
bits
30
22
0
exponent
significand (implicit 1 bit)
8
23
JAVA FLOAT FORMAT
sign
63
bits
62
0
51
exponent
significand (implicit 1 bit)
11
52
JAVA DOUBLE FORMAT
sign
Figure 24-1 Bit Map for Java Float and Double Format
Table 24-1
Bit- and Bit-Field Masks for Double Format
BIT/BIT FIELD
MEANING
MASK
63
sign
0x8000000000000000L
62-52
exponent
0x7ff0000000000000L
51-0
significand
0x000fffffffffffffL
The following are special encodings:
1. Positive infinity is represented as 0x7ff0000000000000L.
2. Negative infinity is represented as 0xfff0000000000000L.
3. All NaNs are represented as 0x7ff8000000000000L.
In all cases, the result is a long integer that when given to the long-
BitsToDouble(long) method, will produce a floating-point value equal to
the argument of doubleToLongBits.
public static long doubleToRawLongBits(double value)
Thismethod is similar to doubleToLongBits() except that if the argument is
a NaN the result is the long integer representing the actual NaN value. Un-
like the doubleToLongBits, the doubleToRawLongBits method does not
collapse NaN values.
 
 
Search WWH ::




Custom Search