Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Square Root algorithm

by jynx (Priest)
on Dec 03, 2001 at 01:03 UTC ( #129003=note: print w/ replies, xml ) Need Help??


in reply to Re: Square Root algorithm
in thread Square Root algorithm


well,

if we're golfing this, you can reduce that line a bit:

sub sqroot { #23456789_123456789_123456789_123456 $g++;$g=($_[0]/$g+$g)/2for-1..pop;$g }
At 29 characters. It seems to work correctly on perl5.6

jynx

update: d'oh, i was erroneously fooled by my browser when entering the snippet, it's actually 36 characters...


Comment on Re: Re: Square Root algorithm
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://129003]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-07-03 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls