delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/24/16:50:35

X-Spam-Check-By: sourceware.org
Message-ID: <46CF4483.6030308@redhat.com>
Date: Fri, 24 Aug 2007 16:50:11 -0400
From: Jeff Johnston <jjohnstn AT redhat DOT com>
User-Agent: Thunderbird 1.5.0.12 (X11/20070719)
MIME-Version: 1.0
To: newlib AT sourceware DOT org
Cc: cygwin AT cygwin DOT com
Subject: Re: Problem with lroundf()
References: <19c433eb0708240916t48556c38k563ada260702e1fd AT mail DOT gmail DOT com> <02f101c7e66b$f1ba3530$2e08a8c0 AT CAM DOT ARTIMI DOT COM>
In-Reply-To: <02f101c7e66b$f1ba3530$2e08a8c0@CAM.ARTIMI.COM>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I have just made a patch.  The code in lroundf() was making a comparison 
between an int and a calculation using sizeof.  This ended up being an 
unsigned comparison and in this case, the int value was < 1.

-- Jeff J.

Dave Korn wrote:
> 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


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019