did you know that the exponent + the fraction (excluding the implicit bit) comes really close to the base2 logarithm of the whole number?
the error is highest when the represented number is pow(2,n)-1 and lowest (zero) when the represented number is pow(2,n)
funny thing isn't it? this makes for a fast (if a little inaccurate) base2 logarithmic calculation, ADD. Changing the base to a known number only takes an additional DIVIDE.
error (top is 0.1, numbers range from 1 through 10240)
probably only for positive numbers
[IEEE related] interesting property
Moderator: MaxCoderz Staff
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am