[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mumath
In article <OLidnVErUrGvSrzbnZ2dnUVZ_q-vnZ2d@comcast.com>,
Michael J. Mahon <mjmahon@aol.com> wrote:
(stuff about muMATH)
> I remember running the CP/M version on my Apple ][+ around
> 1982 and being amazed as it filled the screen with the digits
> of 100 factorial. Arbitrary precision integers and rational
> arithmetic are amazingly powerful, and quite unusual in the
> world of computer arithmetic.
>
> -michael
Welcome to Miracl-C !!!
http://indigo.ie/~mscott/ ==> http://www.shamus.ie/
ftp://ftp.compapp.dcu.ie/pub/crypto/
ftp://ftp.computing.dcu.ie/pub/crypto/
Miracl-C is an arbitrary precision arithmetic library in C which is
free for non-commercial uses. Besides arbitrary precision integers it
also has arbitrary precision real numbers, with all the usual
functions (sqrt, log, exp, sin, etc). But the unique property of
Miracl-C is that it implements reals not as the usual floating-point
numbers but as rational numbers instead. Each real is stored as two
big integers: numerator and denominator. If possible, the exact value
is stored, otherwise the best possible rational approximation is stored.
This has the interesting property that in Miracl-C you can divide a
real number by 3, 10, 7, 113, 4711, or any other integer, and then
multiply the quotient with the same integer and YOU'LL ALMOST ALWAYS
GET EXACTLY THE SAME VALUE BACK! You can't do that with floating-point
numbers: binary f.p. numbers fail to provide an exact result when you
divide by 10. BCD f.p. numbers fix that problem, but o.t.o.h. BCD fail
to provide an exact result when dividing with other numbers, such as 3
or 7.
The only case where Miracl-C fail to provide an exact result in real
arithmetic are those cases where one of the two bigint's used to store
the rational number would overflow - in such cases the closest possible
approximate rational number is used instead - and with bigint's up to
thousands of digits large, you can get quite close rational approximations!
Miracl-C come as source code which you must compile for your system.
By setting a compile-time constant, you decide the maximum number
of digits you wish to use in the bigint's which form the basis of the
Miracl-C library.
Check it out. I think you'll like it!
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/
- References:
- mumath
- From: "John" <zzzjoki@yahoo.com>
- Re: mumath
- From: "Michael J. Mahon" <mjmahon@aol.com>
- Re: mumath
- From: "John" <zzzjoki@yahoo.com>
- Re: mumath
- From: "Michael J. Mahon" <mjmahon@aol.com>