3 ms·
That's called a 'subnormal number'. https://stackoverflow.com/questions/8341395/what-is-a-subnormal-floating-point-number https://stackoverflow.com/questions/8
by asdvjonbn 7y ago
That's called a 'subnormal number'.
https://stackoverflow.com/questions/8341395/what-is-a-subnormal-floating-point-number https://stackoverflow.com/questions/8341395/what-is-a-subnor...
If the exponent is 0, then:
the leading bit becomes 0
the exponent is fixed to -126 (not -127 as if we didn't have this exception)
Such numbers are called subnormal numbers (or denormal numbers which is synonym).
All normal floating-point numbers have an implicit leading significant bit of 1. If the exponent field goes from 1 to 0, then this corresponds to changing the implicit leading bit to a 0, not to decreasing the exponent.
- sillysaurusx 7y agoHmm. But if the exponent’s significant bit goes from 1 to 0, why would that affect the mantissa at all? Also, if the significant bit is always 1, how are negative exponents represented? I understand there’s an implicit “hidden” bit, but what conditions cause it to become 0 instead of 1? And does that bit represent the sign of the exponent, or something else? After reading https://stackoverflow.com/questions/8341395/what-is-a-subnormal-floating-point-number https://stackoverflow.com/questions/8341395/what-is-a-subnor... more carefully, I am more confused than ever. Both visualization sites seem to be leaving out key details. And subnormals only seem to apply when exponent = 0; the visualization problem that OP mentioned happens whenever the leading exponent bit is set to 0, but the rest of the bits can be anything.
- asdvjonbn 7y ago"Significant" is a typo. It should say "significand", i.e. mantisaa. All normal floating point numbers have an implicit most significant significand bit of 1, meaning they are 1.something * 2 ^ exponent. I cannot type the math properly at the moment.
- anaphor 7y agoAnd it can be 0.something, which is a subnormal number. 0 and 1 because it's binary floating point, as you could have decimal IEEE 754 floats too.
- microtherion 7y ago> But if the exponent’s significant bit goes from 1 to 0, why would that affect the mantissa at all? It's not a matter of the "significant bit", but whether the WHOLE exponent is 0 or not. An exponent of 0 is a special case; as soon as you set ANY bit in that exponent, the mantissa goes back to the "implicit 1" prepended bit. > Also, if the significant bit is always 1, how are negative exponents represented? Exponents are represented in a "biased representation", counting up from 2-127. > I understand there’s an implicit “hidden” bit, but what conditions cause it to become 0 instead of 1? Exponent bits being all 0. > And does that bit represent the sign of the exponent, or something else? It represents the leading bit of the mantissa.
- sillysaurusx 7y agoAh! I get it now. I was confused; float toy is correct here. Thanks for the explanations.
- Darkphibre 7y agoAnd subnormal numbers are much more complicated to work with (for some reason). All I know is that DSPs would suddenly start missing their timings if games didn't clamp outputs, because suuuuper quiet reverb drifted into denormalized ranges and would more than double calculation times. This anecdote is from the frontlines of the Xbox 360. :)
- aidenn0 7y agoMany embedded CPUs with hw float (including DSPs) do not have hardware support for denormals; they trap to an ISR that implements them in software. This lets them write IEEE compliant on the spec sheet without having to spend transistors on denormals. In addition, many hardware implementations are much slower on denormals; some x87 implementations were 100s of cycles slower on denormals, NaN and Infinity. A colleague of mine was around during the IEEE-754 days and said the hardware people pushed against denormals and the software people won (possibly with a professor stacking the committee with former students of his? I'm not clear on the details).