From owner-freebsd-chat Wed Oct 21 12:19:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA27344 for freebsd-chat-outgoing; Wed, 21 Oct 1998 12:19:14 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from quackerjack.cc.vt.edu (quackerjack.cc.vt.edu [198.82.160.250]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA27329; Wed, 21 Oct 1998 12:19:03 -0700 (PDT) (envelope-from jobaldwi@vt.edu) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id PAA04945; Wed, 21 Oct 1998 15:18:20 -0400 (EDT) Received: from john.baldwinfamily.org (jobaldwi.campus.vt.edu [198.82.67.63]) by sable.cc.vt.edu (8.8.8/8.8.8) with ESMTP id PAA07695; Wed, 21 Oct 1998 15:18:14 -0400 (EDT) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199810211749.KAA00881@dingo.cdrom.com> Date: Wed, 21 Oct 1998 15:18:14 -0400 (EDT) Reply-To: jobaldwi@vt.edu Organization: Virginia Tech From: John Baldwin To: Mike Smith Subject: Re: Bug in rintf()?... Cc: bde@FreeBSD.ORG, freebsd-chat@FreeBSD.ORG, jobaldwi@vt.edu Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 21-Oct-98 Mike Smith wrote: >> >> I've been having a problem with rintf() not rounding properly, and I don't >> understand the code in /usr/src/libm/common_source/floor.c well enough to >> figure out where it is going wrong. Here is the problem I'm having though: > > We actually use the Sun-supplied math library, so you should be looking > at src/lib/msun/src/s_rintf.c That code's a lot more confusing. :) For what its worth, friends of mine using Linux are having the same problem, so it is probably no big deal. >> rintf(3.5) returns 4.0 >> rintf(3910.5) returns 3910.0 (should return 3911.0) > > Unfortunately, I don't understand what these functions are doing > either, but it's worth noting that rint() suffers the same fate. > (Tested under 3.0). It's supposed to round the float (rint() uses double) parameter to the nearest integral parameter and return it in a float. It seems that some times when a value is an integer and exactly a half, it rounds down instead of up. > -- > \\ Sometimes you're ahead, \\ Mike Smith > \\ sometimes you're behind. \\ mike@smith.net.au > \\ The race is long, and in the \\ msmith@freebsd.org > \\ end it's only with yourself. \\ msmith@cdrom.com --- John Baldwin -- http://members.freedomnet.com/~jbaldwin/ PGP Key: http://members.freedomnet.com/~jbaldwin/pgpkey.asc Every time I turn my computer on, nothing else gets done. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message