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

Re^2: The golf course looks great, my swing feels good, I like my chances (Part IV)

by teebee (Initiate)
on Sep 08, 2013 at 04:38 UTC ( #1052870=note: print w/replies, xml ) Need Help??


in reply to Re: The golf course looks great, my swing feels good, I like my chances (Part IV)
in thread The golf course looks great, my swing feels good, I like my chances (Part IV)

You can save two more strokes by using for instead of while:

54 strokes
use bigint;$p=$p/~(2*$_)*~$_+2e999for-3333..-2;print$p

Replies are listed 'Best First'.
Re^3: The golf course looks great, my swing feels good, I like my chances (Part IV)
by primo (Beadle) on Sep 09, 2013 at 06:28 UTC

    And two more by using $\

    use bigint;$\=$\/~(2*$_)*~$_+2e999for-3319..-2;print

    Thanks!

      Yes, but only if you use a more recent perl, 5.14 or above I think. With perl 5.8 one gets: Can't call method "copy" without a package or object reference at Math/BigInt.pm line 111.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2019-04-25 01:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (124 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!