Why does the integer representation of a floating point number offer a piecewise linear approximation to the logarithm?
I'm going to limit my answer to the question, "Why does the
integer representation of a floating point number offer a
piecewise linear approximation to the logarithm?".
The fast inverse square root is a fascinating topic, but I don't
know enough about it to talk about it.
But it's actually pretty easy to answer the question in the title. First I'll start with the "TL;DR" summary:
This approximation works because when a number is an exact power of the base, its logarithm is (trivially) exactly i...
Read more at stackoverflow.com