Date: Tue, 27 May 1997 21:10:50 -0700 (PDT) From: Tim.Brown@ctg.com To: freebsd-gnats-submit@FreeBSD.ORG Subject: misc/3700: FPE error in "normal" math code Message-ID: <199705280410.VAA21265@hub.freebsd.org> Resent-Message-ID: <199705280420.VAA21638@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 3700 >Category: misc >Synopsis: FPE error in "normal" math code >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 27 21:20:01 PDT 1997 >Last-Modified: >Originator: Tim Brown >Organization: >Release: 2.2.1 >Environment: 2.2.1-RELEASE (generalized, cannot paste) >Description: This line causes a SIGFPE: x = (1900 - 100) / 8; This works fine by itself. In the program however it causes a SIGFPE. All I know is that the source is old, Galactic Bloodshed source) and it requires -D_ANSI_SOURCE just to compile. I am stumped. Other info: This line will also cause a SIGFPE: return -216 + 5 * -1315 * 40 / (40 * -1221111); Makes no sense becasue the code runs fine on older FreeBSD and most other Unixes (AIX, SunOS, Irix, ISC etc) >How-To-Repeat: Not sure >Fix: In the second case above, I noticed that the following is being rounded to zero: 40 * -.00112334. I simply trapped for this and added .0001, an incorrect solution. Question is, why is it happening at all? >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705280410.VAA21265>