SV: Bug in printf ?

Dave Korn dave.korn@artimi.com
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.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: aa2.c
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050630/27c68c35/attachment.c>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list