How do I round this binary number to the nearest even

前端 未结 1 408
后悔当初
后悔当初 2021-01-28 11:09

I have this binary representation of 0.1:

0.00011001100110011001100110011001100110011001100110011001100110

I need to round it to t

相关标签:
1条回答
  • 2021-01-28 11:52

    The text you quote is from my article Why 0.1 Does Not Exist In Floating-Point . In that article I am showing how to do the conversion by hand, and the "GRS" bits are an IEEE implementation detail. Even if you are using a computer to do the conversion, you don't have to use IEEE arithmetic (and you shouldn't if you want to do it correctly ), so the GRS bits won't come into play there either. In any case, the GRS bits apply to calculations, not really to the conceptual idea of conversion.

    0 讨论(0)
提交回复
热议问题