All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Just by hand, only by hand, nothing but by hand? (Posted on 2004-07-26) Difficulty: 4 of 5
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 log10 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?

See The Solution Submitted by Federico Kereki    
Rating: 4.1667 (6 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: put another way | Comment 4 of 7 |
(In reply to put another way by Charlie)

Nice detailed explanation, Charlie.

Just because we are imagining that we have no mechanical aids or tables, there is no reason we can't use a program to do the dog work. And amazingly, the primitive algorithm runs fairly quickly when implemented in QBASIC. Here is the code:

DEFINT H-Q: DEFDBL A-G, R-Z
WHILE 1
PRINT "Enter X and press ENTER": INPUT X: PRINT " X ="; X
IF X < 1 THEN END
B = 10&
IF X >= B THEN END
Y = 1&: W = 0&: T = 1&
R = SQR(B): PRINT "."; :
FOR I = 1 TO 60
Z = Y * R: T = T / 2&
IF Z <= X THEN Y = Z: W = W + T: PRINT "1"; :  ELSE PRINT "0"; :
R = SQR(R)
NEXT
PRINT
PRINT W, Y
WEND

For 2 as input the output is

.010011010001000001001101010000100111110111100111111111111111

.3010299956639813    2

if I have copied it down correctly. The last 20 bits may well not be accurate.

Edited on July 26, 2004, 11:34 pm
  Posted by Richard on 2004-07-26 23:30:13

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (16)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information