Partager via


Double.DoubleToRawLongBits(Double) Method

Definition

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.

[Android.Runtime.Register("doubleToRawLongBits", "(D)J", "")]
public static long DoubleToRawLongBits (double value);
[<Android.Runtime.Register("doubleToRawLongBits", "(D)J", "")>]
static member DoubleToRawLongBits : double -> int64

Parameters

value
Double

a double precision floating-point number.

Returns

the bits that represent the floating-point number.

Attributes

Remarks

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.

Bit 63 (the bit that is selected by the mask 0x8000000000000000L) represents the sign of the floating-point number. Bits 62-52 (the bits that are selected by the mask 0x7ff0000000000000L) represent the exponent. Bits 51-0 (the bits that are selected by the mask 0x000fffffffffffffL) represent the significand (sometimes called the mantissa) of the floating-point number.

If the argument is positive infinity, the result is 0x7ff0000000000000L.

If the argument is negative infinity, the result is 0xfff0000000000000L.

If the argument is NaN, the result is the long integer representing the actual NaN value. Unlike the doubleToLongBits method, doubleToRawLongBits does not collapse all the bit patterns encoding a NaN to a single "canonical" NaN value.

In all cases, the result is a long integer that, when given to the #longBitsToDouble(long) method, will produce a floating-point value the same as the argument to doubleToRawLongBits.

Added in 1.3.

Java documentation for java.lang.Double.doubleToRawLongBits(double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to