Perhaps this might sound like a foolish suggestion, but... Wouldn't it be better (for some definition of better) to design our BigInt type so that we can replace the math engine with a different math engine? Eg, so we could plug in GMP, or PARI, or Miracl, etc.?
(With a fallback to our own math code) Something like Perl5's Math::BigInt does. That way, if someone has a faster math engine, they can use by simply changing a configuration option (which backend BigInt will use), rather than having to change the code which creates the bigints. -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED] ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}