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

> That has a restriction of 64bit binary

Are you sure?

perl -Mbigint -wE 'say 12345678912345678912345678912345678912345678912 +3456789123456789 ** 1234'

Replies are listed 'Best First'.
Re^4: bc within perl
by amudelkaa (Novice) on Nov 08, 2016 at 13:22 UTC
    So this is bigint and not BigInt? Because when I tried doing the same with BigInt, the data hit the ceiling of xffffffffffffffff.

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

      > 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.