Java Double doubleToRawLongBits() MethodThe doubleToRawLongBits() method of Double class returns a floating-point value according to the IEEE 754 floating-point "double format" bit layout, preserving Not-a-Number(NaN) values. SyntaxParametersValue is the double parameter passed which is a double precision floating-point number. Return valueThe doubleToLongBits(double value) method returns the bits that represent the floating-point number.
Example 1Output: 5.5 value in Raw long bits = 4617878467915022336 NaN value in Raw long bits =9221120237041090560 Infinity value in Raw long bits =9218868437227405312 -Infinity value in Raw long bits=-4503599627370496 Example 2Output: Error:(13, 21) java: cannot find symbol symbol: method doubleToLongBits(double) location: variable obj of type com.interf.Double_doubleToRawLongBitsMethod_Example2 Double is a primitive data type. Its object cannot be used to call the Double class method. If you do so, it will give the error like above. Example 3Output: -6.58768566756756E7value in Raw long bits = -4499261384967075684 7658659.78678 value in Raw long bits = 7658659.78678 Next TopicJava-double-doublevalue-method |