Sort of. I think I just mis-read my comparison (got confused coz I was using guess and next guess...)
Change this:
to the more accurate comparison (with 2 more decimal places of accuracy):while (abs($num - $guess**2) > 1e-13) {
and it works fine :)while (abs($num/$guess - $guess) > 1e-15) {
cLive ;-)
In reply to Re: Square Root algorithm
by cLive ;-)
in thread Square Root algorithm
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |