Hi,

The code I am porting to Win64 using MinGW-W64 uses GMP, so I built GMP 4.2.2 with MinGW-W64, after applying the patch I found in the toolchain patches. I crossed compiled this code on a 32 bit Linux system, so I was unable to run the check (normally done with 'make check') on the build.

The GMP seems to work with the simple cases I tested it with, but when I ran the test suite for our code on it, I found some problems related to the conversion of GMP rationals to double. For some rationals that cannot be represented precisely with base 2, the double that is returned is not the cloest double to the rational, for example, for the

rational 4/5, the GMP for W64 returns 0.79999999999999993 rather than 0.80000000000000004, which is a closer double to 0.8 (and is returned by the same GMP on other platforms, with the same double representation).

Is this simply due to some default rounding mode for Win64? (Our Win32 code, compiled with the 32 bit MinGW, does return 0.80000000000000004, although we are currently using GMP 3.3 there) Is it a known problem and is there a work-around? Alternatively, is there some pre-compiled Win64 GMP that could be used with MinGW-W64 compiled code?

Thanks in advance for any information/help!

Kish