Wanted: arbitrary precision integer arithmetic

Max Benson max at umnd-cs.UUCP
Fri Dec 5 03:25:47 AEST 1986


Last time I checked there remain serious bugs in the UNIX mp
library that remain from the PDP-11 days.  One was in the divide
routine that made it divide by zero for only certain large numbers.
This was because the exact integer representation wasn't normalized
at some point.  Another problem was that the in the add/subtract
routine it gets signs mixed up in one case.  I guess that the UNIX
programs that use mp don't ever find the add/subtract bug because
they remove the signs before getting to mp, but I imagine that the
divide bug is out there waiting for you in dc.  I found and tracked
down these bugs for my own purposes, but now I have written a new
library (in C, hopefully vanilla, currently runs on SUN, UMAX4.2) of
arbitrary precision integer arithmetic that is somewhat faster and
better yet public domain!  I can share this with those
interested.  It is part of a larger library of routines for symbolic
mathematics which will be eventually freely available once it is
documented.

Max Benson:  University of Minnesota-Duluth
max at umn-duluth.csnet
...!ihnp4!umn-cs!umd-cs!max



More information about the Comp.unix.questions mailing list