<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,
<br>
<br>I am trying to port our system (the constraint logic programming 
platform ECLiPSe) to 64 bit x86-64 Windows, using MinGW-W64. Our system 
uses GMP to implement large integers and rationals, and I have run into 
some issues with rounding of rationals to double (using mpq_get_d()).
<br>
<br>I am using GMP 4.2.2, because I believe is the GMP version used by 
MinGW-W64 itself. The issue I have ran into is that in some cases, the 
MinGW-W64 version of GMP returns a slightly different double from the 32 
bit Linux version of the same GMP. For example, for the rational 4/5,
<br>the MinGW version returns 0.79999999999999993, while the Linux version 
returns 0.80000000000000004.
<br>
<br>Looking at the manual, it seems that from GMP 4.2 onwards, mpq_get_d() 
should round towards zero, and this suggest to me that 
0.79999999999999993 should be returned, for both platforms (they have 
the same representation for double, I believe). Should the two platforms 
return different values, and is there anyway I can get them to return 
the same value on platforms with the same double representation?
<br>
<br>Thanks in advance for any information!
<br>
<br>Kish Shen
<br>
</td></tr></table><br>