cwoytow@uvicctr.UVic.CA.UUCP (Colin Woytowich) (03/26/90)
Several weeks ago I posted the following request: |Article <946@uvicctr.UVic.CA.UUCP> | Does anyone know where I might find the source (C preferred) for an | infinite precision math handling package? For my thesis (VLSI | Minimization/Design for Testability) I am working with some very | large circuit definitions and 64 bit precision is simply not enough. | I only require basic mathematical operations (nothing exotic). Thanks to all who reponded, below is a summary of some of the responses: ========= >From: so-jho@stekt.oulu.fi (Jouko Holopainen) >I wrote once a program that was able to calculate (decimal or hex) >unlimited precision add & mult. It is written in C and 8086 asm. >Only integers, so if you need fractions, you need to change it. > >I have written some years ago a program that calculated divisions >to any given accuracy (even 2/3 and like). >It was written in basic, so you'd propably not want that (besides, I >cannot be sure if I can find it anymore). > >If you would like to have these, drop me a line. <<< Jouko, thanks for the code (just not portable enough). >>> ============ >From: diwan%takahe@cs.umass.edu (Amer Diwan) >I saw your note regarding an infinite precision package written in C. >I have written such a package which can do basic arithmetic, logarthmic, and >trigonometric functions on large real numbers. You need to specify the >number of digits at the beginning of your program, but it may be as large as >you want. It has been tested on VAX 3700 and Sun 4, but I see no reason why >it may not work on other machines as well. <<< Amer, thanks for the code. Currently converting to TLC. Will let you know how things turn out >>> ============ >From: <uw-beaver!sumax!polari!robert> >You requested a multiple-precision Math package on USENET. I know of one, >but I haven't used it myself. I think it's written in FORTRAN. It's called >Brent's Multiple Precision package. You can probably get it via Email from >one of the netlib sites. <<< Robert, Thanks for the detailed info on how to get bmp. >>> ============ >From: uunet!megatek!frankel (Allan Frankel) >Have you tried the `mp' library in UNIX? It doesn't provide source, >but then you really only need it to work, not to modify the way it works. ============ >From: snyder@CSD4.CS.NYU.EDU (Kirk Snyder) >SETL has infinite precision built-in, so a possibility is to tap >into that. One dialect, ISETL, is available as source. You can get >that via anonymous ftp at clutx.clarkson.edu. It is written in C, so >you might be able to strip out the math routines. > >Finally, the algorithms are in Knuth's Seminumerical Algorithms, and >aren't too tough to code, so it's not worth spending a lot of time >searching. ============ >From: wcs@erebus.att.com (William Clare Stewart) >Do you have access to FTP, or other way to reach the GNU C Compiler? >I've heard that there's an infinite precision library either with it >or with the G++ stuff; it's been too big for me to wade through so I >don't know where in GNU to find it, though.> ============ >From: bothner@cs.wisc.edu (Per Bothner) >I assume someone has told you about libg++? It has code >for infinite-precision integers and rationals. >It is written in C++, though you might be able to hack >it to work in C. Sources: prep.ai.mit.edu. ============ >From: uw-beaver!ames!mailrus!uunet!iconsys.icon.com!tom (Tom Kimpton) >Just recently someone else asked this, and I believe that they >were told to look at the UNIX sources for "bc" (maybe "dc") >which is a line oriented calculator program. ============ >From: alms@cambridge.apple.com (Andrew L. M. Shalit) >The T programming language (a version of Lisp) has unbounded >integers. Sources are available by FTP from Yale, I believe. >If you ask in comp.lang.lisp or comp.lang.scheme you could >probably get a pointer to the sources. >I'm not sure what language the bignum code is written in. >I believe it's written in a sort of pseudo-lisp, but I'm >not sure. ===================================================================== After examining the alternatives I have decided to use code supplied by Amer Diwan ( diwan%takahe@cs.umass.edu ) as it meets all my requirements (C, portability, etc.). Once again thank you all for your advice and help, Colin Woytowich =================================================== Internet: cwoytow@uvicctr.UVic.CA UUCP: ...!{uw-beaver,ubc-vision}!uvicctr!cwoytow ===================================================