1

I want to represent 1/LN(2), 1.442695041 in 32 bits binary. I found that must be 1.0111000101010100011101100101001, but a work collegue insists it needs to be shifted right and add an integer of "1", becoming 1.10111000101010100011101100101001. Can someone clarify it for me?

Rob Arthan
  • 48,577
  • 2
    This isn't a question about mathematical logic. When you say "32 bits binary", do you mean the mathematical binary representation with 32 digits (bits) of precision or the binary representation in a standard computer encoding, e.g., IEEE? In either case, I think your colleague is wrong - it sounds like they are confused about how the IEEE encoding elides the leading digit of the mantissa. Your answer looks good for the first reading according to the bc program on my Mac which computes your 32 bit binary number as 1.4426950407214462757110595703125 in decimal. – Rob Arthan Feb 21 '19 at 22:45
  • 1
    ... see https://en.wikipedia.org/wiki/IEEE_754-1985 for how the IEEE encoding avoids storing the leading digit of the mantissa . – Rob Arthan Feb 21 '19 at 22:55

0 Answers0