3 ms·
"7 Bits Are Not Enough for 2-Digit Accuracy If You're Using a Naive Encoding." Information theory says you can fit 100 values into 7 bits. If you're not going
by trjordan 12y ago
"7 Bits Are Not Enough for 2-Digit Accuracy If You're Using a Naive Encoding."
Information theory says you can fit 100 values into 7 bits.
If you're not going to use the right encoding, I can also come up with encodings for which 100 bits isn't enough to fit 100 values.
- vidarh 12y agoThe article is specifically about round-tripping between base-10 and base-2 floating point because the precision of floating point is a very real issue if you're doing conversions. This is e.g. one of the reasons why decimal fixed point is preferable for many types of operations. Fair enough that the title leaves it ambiguous, but the ambiguity is resolved in the first sentence of the post, and further clarified in a lot of detail over the next paragraph and a half.
- trjordan 12y agoSure. I'm mad at the headline. The whole setup is a problem that shouldn't exist, because you're using 7-bit floats for an inappropriate range. When are you going to run into 7-bit floats as the default? If you're not thinking about it, I suppose this could happen if you scale it up, but it's less surprising to say "4862057400958023983457609283094859 can't be represented exactly in floats".