in reply to Re: Division of big integers
in thread Division of big integers

Yes, I am aware. My goal is to write this in pure perl. The goal isn't necessarily to produce the smallest perl script possible but one that is easy to understand and does perform well considering it's written in pure perl. So, I am looking for such a solution. Remember, I am just a hobby programmer, which means I am not getting paid for the lines of code I write. And I am not getting paid by the hour or by the product I produce. It's entirely for entertainment and fun. So, with that in mind, I am trying to understand how to divide a big integer by another big integer, and this is quite tricky, because a big integer means it can be hundreds of digits long, so it's not going to fit into a regular perl number. Normally, perl numbers have 15 significant digits, and anything beyond that is lost because it has to fit into 64 bits. So, therefore, using regular numbers is out of the question, I guess.

Replies are listed 'Best First'.
Re^3: Division of big integers
by LanX (Saint) on Jan 01, 2025 at 11:13 UTC
    These modules are pure Perl, that's why their performance is poor Perl. (SCNR)

    You might learn a bit by looking into them. :)

    Good luck!

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

    PS: I seem to remember they had XS shadows, but my brain feels 2025 years old...

    Update

    Yep, multiple XS modules available, like Math::BigInt::GMP and Math::BigInt::FastCalc

    syphilis might know better about the pro and cons