5 ms·
> 0.1 has no finite representation in binary. b1 / b1010 I don't see the problem. Did you mean to say it has no finite representation in the IEEE float format
by DarkWiiPlayer 6y ago
> 0.1 has no finite representation in binary.
b1 / b1010
I don't see the problem. Did you mean to say it has no finite representation in the IEEE float format?
> It was never exact to begin with.
But the format sadly gets used in situations where people expect it to be reasonably accurate, where it isn't, because developers either underestimate the "reasonable" or overestimate the "accurate" part.
It's just sad that most mainstream programming languages have no native accurate data type for rational numbers.
- Gracana 6y ago> Did you mean to say it has no finite representation in the IEEE float format? Of course that's implied.
- DarkWiiPlayer 6y agoIt was a rhetoric question; I just wanted to point out that people blame these inaccuracies on "binary representations" when in reality it's just this one binary representation that's broken.
- deleted 6y ago[deleted]
- account42 6y agoSo are you saying that ⅓ has a finite presentation in decimal? Finite binary rationals ⊋ finite binary numbers.
- DarkWiiPlayer 6y ago> So are you saying that ⅓ has a finite presentation in decimal? Yes: ⅓
- slavik81 6y agoI meant in positional notation, but most people know that as "decimal notation". Unfortunately, that implies base 10, so I avoided the term. I gave both an example in binary and an example in decimal to clarify my imprecise terminology. I worry that by objecting only to the binary example, you may confuse people into thinking the two are different.