SV: Bug in printf ?

Dave Korn
Thu Jun 30 17:08:00 GMT 2005

----Original Message----
>From: Brian Dessent
>Sent: 30 June 2005 16:58

> Dave Korn wrote:
>>   Absolutely, there's a rounding error of some sort.  Compare the
>> difference when compiling the testcase with -mno-cygwin (i.e. using
>> mingw maths lib): 
> Isn't this just a case of the Cygwin math library choosing "round to
> even" and the MSVCRT/mingw library choosing "0.5 always rounds up"?  

  No, I really don't think that's the case, in fact I reckon they both
default to the same roundingmode, and the discrepancy remains the same in
any rounding mode.  Have a go with the attached version of the testcase,
which allows you to choose any rounding mode you like at runtime: just pass
a hex constant from the set (0, 0x400, 0x800, 0xc00) on the command line.

Can't think of a witty .sigline today....
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: aa2.c
URL: <>
-------------- next part --------------
Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list