Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^4: bc within perl

by amudelkaa (Novice)
on Nov 08, 2016 at 13:22 UTC ( [id://1175540]=note: print w/replies, xml ) Need Help??


in reply to Re^3: bc within perl
in thread bc within perl

So this is bigint and not BigInt? Because when I tried doing the same with BigInt, the data hit the ceiling of xffffffffffffffff.

Replies are listed 'Best First'.
Re^5: bc within perl
by Corion (Patriarch) on Nov 08, 2016 at 13:27 UTC

    Math::BigInt implements the code for arbitrary precision. bigint enables that code transparently wherever it is used.

Re^5: bc within perl
by choroba (Cardinal) on Nov 08, 2016 at 13:29 UTC
    > with BigInt, the data hit the ceiling of xffffffffffffffff.

    Show the code. It works for me:

    #!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Math::BigInt; my $x = 'Math::BigInt'->new('123456789' x 5); say $x ** 1234;

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      That's again my bad. I tried to do a sprintf after the math op using BigInt. BigInt is just fine and I am stupid enough to doubt it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-16 18:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found