Understand the output
The output of the program should be something like this:
Double a = 10.002
Double a in binary = 0100000000010010001100110011001100110011001100110011001100110011
Double b = -60.123456789
Double b in binary = 1100000001011111010110011011010100001110010100010100001111000110
Double c = 0.12345
Double c in binary = 0011111110110001010010100011110101110000111101011100001010100000
Here, we can see that the getLongBits()
method returns the long bit representation of a given double input. We have used the Long.toBinaryString()
method to convert the long value to its binary representation.