in reply to Reversed long division

Have you thought of running "bc" through backticks,expect or IPC? It will handle thousands of digits, and is fast.

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Reversed long division
by ambrus (Abbot) on Jun 30, 2005 at 16:30 UTC

    I am not so sure, because bc internally calculates in decimal (at least the GNU version does), so you'd have to convert the very long base 222 number to base 10, and the result back, which could take much time.

    Of course, there are other bignum libraries apart from bc, but all of those I know calculates in a fixed base, which is either a power of 2, or a power of 10. It's unlikely that you'll find a pre-written bignum library that uses base 222. (However, you could still learn much from their code.)