Aug 24, 2004 18:00
To keep with Isadora's theme of integral icons, I have created on for myself.
So look...
On another note, due to boredom in Computer Science and Calculus today, I figuered out an algorithm for doing squares and square roots through addition, no multiplication.
For a square:
x = the number to be squared.
Go from 1 to 2x-1 in intervals of 2, this will be I
Once you hit x, then you have your square.
S+I set this equal to S then increase I by 2
Example:
3 = the number to be squared.
Go from 1 to 5 in intervals of 2, this will be I
Once I = x, stop. This is the answer.
3 + I= 3 + 1= 4
4 + 2= 6
6 + 3 = 9
Square roots is the opposite.
y = the number to be square rooted.
Subtract until you get to 0, then however many iterations it took, that is your answer.
Start at 1 and work your way up in intervals of 1, this will be I
y - 1 - 2I = y
Example:
16 = the number to be square rooted.
Subtract until you get to 0, then however many iterations it took, that is your answer.
Start at 1 and work your way up in intervals of 1, this will be I
1.) 16 - 1 - 2I = 16 - 1 - 2(0) = 15
2.) 15 - 1 - 2(1) = 12
3.) 12 - 1 - 2(2) = 7
4.) 7 - 1 - 2(3) = 0
At the fourth iteration you hit 0, thus the square root of 16 is 4. I find this to be rather interesting, because before now, the only method I knew was guess and check. Though of course this version only does whole numbers. I plan on finding a way to get it to do decimal places too. Have fun! And if you want the source for a Ti-83+ for some reason, I can give it to you, it is really short.