Convert Double to Binary representation?

后端 未结 6 1614
深忆病人
深忆病人 2020-11-28 16:04

I tried to convert a double to its binary representation, but using this Long.toBinaryString(Double.doubleToRawLongBits(d)) doesn\'t help, since I have large nu

6条回答
  •  一个人的身影
    2020-11-28 16:30

    You can use Double.toHexString(d) and then transform the hexadecimal string into a binary one using a for loop and a StringBuilder.

提交回复
热议问题