Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: computing square root by hand -- no sqrt (golf, beginner)

by Juerd (Abbot)
on May 10, 2002 at 22:18 UTC ( [id://165794]=note: print w/replies, xml ) Need Help??


in reply to Re: computing square root by hand -- no sqrt (golf, beginner)
in thread computing square root by hand -- no sqrt (golf, beginner)

print $ARGV[0]**.5

This is the best answer I've seen in this thread :) It's clear, short and very precise...
How about some golfing while you're at it?

die+shift()**.5,$/
I know that this is 18 strokes like yours, but this one prints a newline ;)

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: Re: computing square root by hand -- no sqrt (golf, beginner)
by jynx (Priest) on May 12, 2002 at 04:55 UTC

    Since you're only using one argument you can call it with one argument and shorten it to 16:
    die pop()**.5,$/
    but that's bending the rules...
    jynx

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-24 19:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found