Commit Graph

3 Commits

Author SHA1 Message Date
Neil Toronto
fff521212f Fixed infinite printing loop
When libmpfr wasn't available, the function created by `make-not-available'
would try to print any _mpfr arguments, which would call the custom _mpfr
printer, which would try to use a libmpfr function, which would call the
function created by `make-not-available', which would try to print...
2012-12-07 11:48:46 -07:00
Neil Toronto
fcc08fa89e Fixed bigfloats on Win64. Win64's long type is 32 bits and GMP's default is to
use longs for the "limbs" of bigints. However, when GMP's configure script
detects that mingw64 is compiling, it defines LONG_LONG_LIMB, which makes the
type of limbs long long, or 64 bits. This is fine; a 64-bit machine should use
64-bit ints for the digits of its bigints. It would have been nice to know
this special case earlier, though I can see why it's not advertised: most
users don't need to know, and it seems like it's obviously the right choice to
make when dealing with Win64's annoying ABI.

Made "mpfr.rkt" search for 'mpfr_set_z_exp if 'mpfr_set_z_2exp isn't found.
Hopefully this allows the bigfloat tests to finish on DrDr. If not, DrDr
will need a libmpfr upgrade.

Made some minor doc fixups
2012-12-05 20:29:59 -07:00
Neil Toronto
d935bc0643 Split "mpfr.rkt" into "gmp.rkt" and "mpfr.rkt"
Fixed bigfloat functions that assumed (fixnum? x) means x fits in a _long
(not true on Win64)

Hopefully fixed dangling pointer errors that broke `math/bigfloat' on Win64.
It apparently had no _long/_int mismatches, but GC on Win64 will run between
creating an `_mpz' and using its value after passing it as an output argument
to MPFR functions. That doesn't seem to happen on 64-bit Linux or Mac. No
idea why, but Win64 exposed the problem so... that's good, I guess.

Rewrote `rational->bigfloat' to not use GMP's rationals

More/better bigfloat tests

Added bigfloat stress test w/ weak leak detection

Reenabled custodian shutdown callback that clears MPFR constants, because it
seems to work now

Removed `mpfr-available?' because it would only return non-#f
2012-12-03 22:45:31 -07:00