Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: [Study]: Searching for square rootsby Limbic~Region (Chancellor) |
on Nov 14, 2006 at 21:21 UTC ( [id://584072]=note: print w/replies, xml ) | Need Help?? |
roboticus,
Removing a node's content is generally frowned upon regardless of correctness. It is best to FWIW, here is my take without having looked any other solutions to include monsieur_champs'. If it isn't obvious, it is a binary search. Update: The adjustment for values < 1 can be mathematically simplified. Additionally, a much faster converging algorithm would be $try = (($tgt / $try) + $try) / 2. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|