*BSD News Article 96581


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!news.ececs.uc.edu!newsfeeds.sol.net!europa.clark.net!ais.net!news.idt.net!oksennus.binary.net!news.mid.net!news.cjnetworks.com!usenet
From: nospam@here
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: FreeBSD 221 math problem, help
Date: 31 May 1997 07:52:39 GMT
Organization: Capital Journal Networks
Lines: 45
Distribution: world
Message-ID: <5molc7$nns@topeka.cjnetworks.com>
References: <01bc6afa$0dd23720$3976c9ce@amuancw110> <338E6020.5045@OntheNet.com.au>
NNTP-Posting-Host: port209.cjnetworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: <QVT/News ver. 4.0>
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:41916

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.