Java Double longBitsToDouble() Method

The longBitsToDouble() method of Java Double class returns the double value equating to an acknowledged bit representation.

The result is:

  1. Positive infinity, if the argument passed is 0x7ff0000000000000L.
  2. Negative infinity, if the argument passed is 0x7ff0000000000000L.

Syntax

Parameters

bits - is the long integer passed.

Return value

The longBitsToDouble() method returns a floating point value of type double with identical bit pattern.

Example 1

Output:

Float value after conversion = 3.7928E-316
Float value after conversion = 2.40447E-319
Float value after conversion = NaN

Example 2

Output:

1. 2139095040 value = 1.0568533725E-314
2. 2139095040 value = NaN
3. 2147483647 value = 1.060997895E-314
4. -2147483648 value = NaN

Example 3

Output:

Enter first integer:
648375
1. Double value = 3.2034E-318

Enter Second negative integer
-48755
2. Double value = NaN