3 ms·
> À float can represent some of its range with more accuracy, and some with much less accuracy. IEEE floats are guaranteed to _do_ that. They’re not distribute
by Someone 5y ago
> À float can represent some of its range with more accuracy, and some with much less accuracy.
IEEE floats are guaranteed to _do_ that. They’re not distributed evenly across their range, so the absolute error of replacing a real by the closest float will vary across their range.
They also aren’t distributed evenly after taking logarithms, so the relative error of replacing a real by the closest float will also vary across their range.
(That is unavoidable for the reals if you want to represent zero or negative numbers)
- sharikous 5y agoWhile it is right that errors are not represented evenly even on a logarithmic scale, it is still a useful approximation to make. In fact the integer value of the binary representation of a float approximates crudely the logarithm of the float. This was used in Quake's famous inverse square root approximation
- colejohnson66 5y agoA really good video on how that worked: https://www.youtube.com/watch?v=p8u_k2LIZyo https://www.youtube.com/watch?v=p8u_k2LIZyo