3 ms·
> For float, sometimes x + 1 = x Would you spell this out for us?
by gkop 5y ago
> For float, sometimes x + 1 = x
Would you spell this out for us?
- eska 5y agoIf x is a huge number, then elimination can happen. Floating point numbers store a mantissa and an exponent, m^e. When you have a huge number the exponent will be large. So the mantissa can not express the tiny number anymore.
- cmeacham98 5y agoFloats effectively work by specifying a level of precision and a multiplier against that. For big numbers, you need a lower precision (larger gap) between the representable values. Eventually the precision gets so low that adding 1 doesn't reach the next possible value and rounds back down to your current value.