This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: Problem with lroundf()
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: <newlib at sourceware dot org>
- Cc: <cygwin at cygwin dot com>
- Date: Fri, 24 Aug 2007 17:29:29 +0100
- Subject: RE: Problem with lroundf()
- References: <19c433eb0708240916t48556c38k563ada260702e1fd@mail.gmail.com>
- Reply-to: <newlib at sourceware dot org>
On 24 August 2007 17:16, François-Xavier Coudert wrote:
> Hi all,
>
> I think the following exhibits a bug in the lroundf() routine:
Gahh, it's entirely likely, we keep finding cruft and corner cases in the fp
math. Cygwin's maths routines come from newlib; post redirected there and
fups-to set.
> $ cat a.c
> #include <math.h>
> #include <stdio.h>
>
> int main (void) {
> printf ("%d\n", (int) lroundf(0.7));
> }
>
> $ gcc a.c && ./a.exe
> 0
>
> The result of lroundf(0.7) should be 1, not 0. If lround() is used
> instead of lroundf(), then it's working OK.
>
> I didn't file a PR in bugzilla because the bug report instructions say
> to send a mail to this list, but I can open one if need be.
>
> Thanks,
> FX
Might get some spare time over the weekend to look at this with you, might not.
Sorry I can't be more certain.
cheers,
DaveK
--
Can't think of a witty .sigline today....