I need to turn double into long preserving its binary structure, not number value. Just change type, but leave binary value as it is. Is there a native way to do it?
Asked
Active
Viewed 2,018 times
6
-
3You can check this http://stackoverflow.com/questions/2905556/how-can-i-convert-a-byte-array-into-a-double-and-back – Nitin Chhajer Feb 25 '13 at 11:29
1 Answers
11
There is Double with to doubleToLongBits and doubleToLongRawBits. Javadoc is your friend.

Joop Eggen
- 107,315
- 7
- 83
- 138