Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: bc within perl

by Athanasius (Archbishop)
on Nov 08, 2016 at 09:22 UTC ( [id://1175527]=note: print w/replies, xml ) Need Help??


in reply to bc within perl

Hello amudelkaa, and welcome to the Monastery!

I am using bc because the numbers I am using are beyond 64bit in size.

Please note that Perl has core modules to handle arbitrary-size numbers:

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: bc within perl
by amudelkaa (Novice) on Nov 08, 2016 at 09:32 UTC
    I did try BigInt prior to this. That has a restriction of 64bit binary and doesn't support beyond that. I am not sure on BigFloat nor BigRat. The numbers I have in mind are going to be at most 73bits and I couldn't find a better alternative to 'bc' so far.
      > That has a restriction of 64bit binary

      Are you sure?

      perl -Mbigint -wE 'say 12345678912345678912345678912345678912345678912 +3456789123456789 ** 1234'
        So this is bigint and not BigInt? Because when I tried doing the same with BigInt, the data hit the ceiling of xffffffffffffffff.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-19 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found