Basically I have a Double defined in Scala and I'd like it in a binary representation. For example:
val myDouble: Double = 0
val myDoubleAs64BitString = "00000000"+
"00000000"+
"00000000"+
"00000000"+
"00000000"+
"00000000"+
"00000000"+
"00000000"
This may sound and look crazy but basically for what I'm doing it's not. I'm basically writing a Chess application and I need a decent way of getting feedback while testing bitboard representations.
The syntax in Scala is the same for this problem.
java.lang.Long.toBinaryString(java.lang.Double.doubleToRawLongBits(myDouble))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With