3 ms·
> Over 99% of all values represented in [0,1] are in [0,0.5]. Is that true if you exclude denormals?
by forrestthewoods 2y ago
> Over 99% of all values represented in [0,1] are in [0,0.5].
Is that true if you exclude denormals?
- cornstalks 2y agoYes. Subnormals start at <1.0 * 2^(-126). Between [1.0 * 2^(-126), 0.5] there are 125x more distinct float values than there are in the range [0.5, 1].
- edflsafoiewq 2y agoYes. The floats in [0,1) come in blocks: [1/2, 1), [1/4, 1/2), [1/8, 1/4), etc. There are 2^23 floats in each block and there are 127 blocks. The reason there are so many floats in [0, 0.5] is only one block, [1/2, 1), is outside that range. If you exclude the denormals (which have a special block that stretches to 0, [0, 1/2^126)), you still just excluded a single block.
- forrestthewoods 2y agoAhhh that makes sense. That’s a much more clear explanation. Thanks!