i want code for finding square root using mental arithmetic

Pages: 12
Are you trying to get the user to make a guessing game out of the square root or do you want the PC to do it like a person would? If the latter you need to write the program to do the steps a person would take to guess a square root to its closest precision you want.

You probably want to think how a person guesses a square root:
* What number do you want the square root of?
* What perfect squares come within range of this number?
* What perfect square is closer?

Then you'd want to loop inching the precision ever closer until you get with a percentage of the answer.
That's how I would get the PC to GUESS the number.
closed account (4Gb4jE8b)
brown3141
You can also use continued fractions.


stereoMatching
How about Taylor Polynomials?


I love you guys :)

Though I would think Taylor polynomials (i was taught to call them series but w/e, unless of course they're different, in which case i suggest taylor series) would be easier to program. But that's off topic of the original problem.

Wolfgang's answer previous to mine: +2, one for answer, one for explanation. Well done my friend.
Topic archived. No new replies allowed.
Pages: 12