Imagine you are living a lot of years ago, without calculators, slide rules, tables of logarithms, or any kind of tool but paper and pencil... how would you go about calculating log
10 of 2 -- or of any other number?
By the way, if your solution required calculating powers, or if you just wanted to check your solution, how would you calculate 10 to the 0.30103... power, or any other?
10^(b1*(1/2)+b2*(1/4)+...)=[(10^(1/2))^b1]*[(10^(1/4))^b2]*... .
Hence we can take the square root of 10, the square root of the square root of 10,... and starting with the value 1, multiply or not by the 2^n-th root of 10 and test against the target of 2 or whatever other number <10 that we seek the log of. This will give the base 10 logarithm in binary. For the target of 2, sqrt(10) > 2, so b1=0; sqrt(sqrt(10)) < 2, so b2=1; [sqrt(sqrt(10)) ]*[sqrt(sqrt(sqrt(10)))] > 2, so b3=0; etc.
|
Posted by Richard
on 2004-07-26 13:49:47 |