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