in reply to Re: Re: Square Root algorithm
in thread Square Root algorithm
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 ;-)
|
|---|