*BSD News Article 96676


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mira.net.au!pumpkin.pangea.ca!eru.mt.luth.se!www.nntp.primenet.com!nntp.primenet.com!feed1.news.erols.com!howland.erols.net!gatech!news.jax.bellsouth.net!news.rdu.bellsouth.net!not-for-mail
From: Arthur Pesa <apesa@bellsouth.net>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: FreeBSD 221 math problem, help
Date: Sun, 01 Jun 1997 22:36:16 -0400
Organization: Integrated Object Development
Lines: 51
Message-ID: <339231A0.61B@bellsouth.net>
References: <01bc6afa$0dd23720$3976c9ce@amuancw110> <338E6020.5045@OntheNet.com.au> <5molc7$nns@topeka.cjnetworks.com>
Reply-To: apesa@bellsouth.net
NNTP-Posting-Host: d00030.rdu.bellsouth.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01Gold (WinNT; I)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:42013

nospam@here wrote:
> 
> In article <338E6020.5045@OntheNet.com.au>, Tony Griffiths
> <tonyg@OntheNet.com.au> writes:
> 
> >Tim Brown wrote:
> >>
> >> I am getting a math error (FPE) in some pretty old code.  The code works
> >> basically everywhere but freebsd 221.  It even seems to work on older
> >> freebsd systems.
> >>
> >> The code is:
> >>
> >> -216 + 5 -1316 *40 / (40 * -.00012120)
> >>
> >> I have broken it down like so to narrow it down:
> >>
> >> double x = -217 +5 -1316 *40;
> >> double y= 40 * -.00012120;
> >> double a = x/y;
> >>
> >> I ran this and when I got the FPE while in gdb, y was 0.  Why??
> >> It seems that "y" was rounded off to 0.  All other OS's I have run this on
> >> (AIX, SunOS, older freeBSD, others) do not have this problem.  Is there a
> >> magical gcc command line option I need to use?
> >
> >You're not using a Pentium with the FP bug by any chance?
> >
> >Is there a program on the net for testing if you have a "dud" Pentium?
> >The problem was in multiplication (I think)!
> >
> >If so please post a pointer...
> 
> Terje Mathieson (sp?), an x86 assembly language guru in Norway
> wrote a nice little assembler routine for testing for the FDIV
> bug back when it was first announced.  I have a copy, but it's
> locked away in an ancient backup of WFW 3.11 that I'm not gonna
> restore for anybody.  The original poster would have to have a
> fairly old Pentium to be affected by this.  My thought on this
> is that the poster probably needs to compile in hardware FP
> support.  BTW, I think that assembler routine was p87test.com
> (possibly in a .zip file with other things like a readme and
> the source), which archie should find without too much difficulty.
> 
> --------------
> Troy Smith (tdsmith at cjnetworks dot com)
> I hate having to use spamfoil measures.
Try http://www.x86.org Here you will find Robert Collins beating up
Intel. He also has written an assembly Lang utility that will find the
FIST (float to integer store) bug. He has several tools you may be
interested in, The site in general is great.