Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Adding really big numbers

by Khen1950fx (Canon)
on Feb 23, 2013 at 01:58 UTC ( #1020266=note: print w/replies, xml ) Need Help??


in reply to Adding really big numbers

What lib are you using? How are you declaring accuracy and precision? Maybe this'll help:
#!/usr/bin/perl -l BEGIN { $| = 1; $^W = 1; } use strict; use warnings; use bignum lib => 'FastCalc'; use Memoize; memoize('really_big'); really_big(); sub really_big { bignum->accuracy(15); bignum->precision(15); my $big_number = 3710728753390210279879799822083759024651013574025 +0 + 46376937677490009712648124896970078050417018260538; print $big_number; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020266]
help
Chatterbox?
[Eily]: I actually used the eskimo greeting :P, I just wrote the "canonical" form of the oneliner here
[Discipulus]: next time you can add `SARGV-1` and if still not impressed pass a 'rm -f..' as last arg
[Eily]: :)
[Eily]: or I might be tempted to send him an Acme::EyeDropsed file next time
[Eily]: Acme::Bleach is tempting, but it will look like I'm just using the one module that does precisely exactly what he wants

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-04-26 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (483 votes). Check out past polls.