From owner-freebsd-chat Wed Oct 21 19:54:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA17870 for freebsd-chat-outgoing; Wed, 21 Oct 1998 19:54:31 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from home.stratos.net ([207.87.124.49]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA17854 for ; Wed, 21 Oct 1998 19:54:22 -0700 (PDT) (envelope-from drifter@home.stratos.net) Received: (qmail 15521 invoked by uid 1001); 22 Oct 1998 03:02:00 -0000 Message-ID: <19981021230200.A15504@net> Date: Wed, 21 Oct 1998 23:02:00 -0400 From: Rob To: "Christopher R. Bowman" , EddieB Cc: Mike Smith , freebsd-chat@FreeBSD.ORG Subject: Re: Bug in rintf()?... References: <199810211749.KAA00881@dingo.cdrom.com> <199810220017.TAA06846@quark.ChrisBowman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <199810220017.TAA06846@quark.ChrisBowman.com>; from Christopher R. Bowman on Wed, Oct 21, 1998 at 07:10:31PM -0400 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, Oct 21, 1998 at 07:10:31PM -0400, Christopher R. Bowman wrote: > At 12:52 PM 10/21/98 -0500, EddieB wrote: > > > >> > >> > rintf(3.5) returns 4.0 > >> > rintf(3910.5) returns 3910.0 (should return 3911.0) > >> > > > >I haven't really the slightest clue about coding (Yea I'll admit it) but I > >do remember from physics / chemistry classes that .5 #'s are rounded > >different. IE: 3.5 rounds to 4.0 and 4.5 also rounds to 4.0. If the # > >preceeding the .5 is even it just drops the .5, if the # preceeding the .5 > >is odd, it rounds up (you always get an even # as an answer) > > > >Probably not what is happening with that but I was bored and decided to > >write an email :) > > > >Jon > > > >EddieB/IRC > >IRCop : irc.dragondata.com > > NewNet HUB Server > > Never in all my life heard this, and I got 10 years of engineering education > with more physics than I can shake a stick at, behind me. > > What logical reason is there for this? Come to think of it, I remember that to. Back in high school, I had a chemistry teacher who told us that we were supposed to round up on odd numbers and down on even numbers. The idea was that to not to would skew results somehow by always rounding one way. Observing those rules, you would "cancel out" your "round-up" bias. That's the way I learned it, anyway. -Rob To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message