Omnimaga
General Discussion => Other Discussions => Math and Science => Topic started by: squidgetx on February 06, 2011, 08:09:01 pm
-
Why would you need this??? We have calculators! ;)
Anyway, thought some of you guys would appreciate this ;)
edit: holy, massive picture x.x
-
LOL. I love it. Might just show it to my math teacher.
-
Ah yes, this is a very nice method. I've been doing this since 7th grade :D I happened to have a trig book from the 50's, no electronics, and a whole summer vacation of having fun with math.
In binary:
Let:
A=Result
B=Remainder
Initial:
d=0
b=01 01.00 00
a=0
Cycle 1
;shift upper two bits in b to D
b=01 00 00 00
d=00 00 00 01
2*A
;A=00 00 00 00
A→C
;C=00 00 00 00
2*C+1
:C=00 00 00 01
cp C,D
if C is less than or equal to D
D-C→D
; D= 00 00 00 00
A+1→A
;A=00 00 00 01
Repeat
;shift upper two bits in b to D
b=00 00 00 00
d=00 00 00 01
2*A
;A=00 00 00 10
A→C
;C=00 00 00 10
2*C+1
:C=00 00 00 11
cp C,D ;C is greater than D
x if C is less than or equal to D ;False
x D-C→D ;Not Executed
x ; D= xx ;""
x A+1→A ;""
x ;A=xx ;""
Repeat
The first two bits calculated in this case is the integer part and after that all the bits are the fractional part (in binary).
EDIT: Those ;D are supposed to be ; D. grrr...
-
Nice, I always wondered how to make square roots by hand. Thanks :D
-
The square root one is a specific example of the Shifting nth root algorithm (http://en.wikipedia.org/wiki/Shifting_nth_root_algorithm)
You can also find any higher roots, and in any base! ;D