mpfr

Haskell FFI / C MPFR library wrapper woes

In order to create an arbitrary precision floating point / drop in replacement for Double, I'm trying to wrap MPFR using the FFI but despite all my efforts the simplest bit of code doesn't work. It compiles, it runs, but it crashes mockingly after pretending to work for a while. A simple C version of the code happily prints the number "1...

Building GMP library with Visual Studio?

Is there an easy way to build the GMP (GNU Multiple Precision Arithmetic Library, http://gmplib.org) under Windows, using Visual Studio 2005? I tried to find information about building the library myself, but could not find anything that really helped me. I'm not very experienced with building libraries myself (I've managed to build boos...

Platform independent math library

Is there a publically available library that will produce the exact same results for sin, cos, floor, ceil, exp and log on 32 bit and 64 bit linux, solaris and possibly other platforms? I am considering the following alternatives: a) cephes compiled with gcc -mfpmath=sse and the same optimization levels on each platform ... but its n...

MPFR rounding issue

I've just started to work with MPFR arbitrary precision library and quite soon encounter very wierd behaviour. The main goal of using it was to improve precision of lagre argument trigs and this works extremly good in MPFR. But then I decided to check out simple math and it was unbeleavable - even in straightforward examples with strict...

MPFR Rounding 0.9999 to 1?

I'm attempting to store the value 0.9999 into an mpfr_t variable using the mpfr_set_str() function But 0.9999 is rounded to 1 (or some other value != 0.9999) during storage, no matter the round value (GMP_RNDD, GMP_RNDU, GMP_RNDN, GMP_RNDZ) So what's the best method to store 0.9999 in an mpfr_t variable using mpfr_set_str()? Is it poss...

GCC cant find GMP, MPFR and MPC libraries

I am trying to cross-compile GCC on Mac OS 10.5.7. I used this command to configure GCC after installing GMP, MPFR, and MPC: ../gcc-4.5.0/configure --target=$i586-elf --prefix=/usr/local/cross \ --disable-nls \ --enable-languages=c,c++,fortran,java,objc,obj-c++,treelang,ada \ --without-headers --with-libiconv-prefix=/opt/loc...