Date: Tue, 21 Mar 2000 08:47:00 +0000 From: David Malone <dwmalone@maths.tcd.ie> To: current@freebsd.org Subject: Floating point exceptions. Message-ID: <200003210847.aa00165@salmon.maths.tcd.ie>
next in thread | raw e-mail | index | archive | help
Floating point exceptions seem to have been turned off by default:
gonzo 13% uname -r
5.0-CURRENT
gonzo 14% cat a.c
double div(double x,double y) { return x/y; }
int main() { double x; x = div(1.0,0.0); printf("%f\n",x); }
gonzo 15% gcc -o a a.c
gonzo 16% ./a
Inf
This seems to produce an SIGFPE on 3.0, which I would have thought
was the correct thing to do:
walton 12% uname -r
3.4-STABLE
walton 13% cat a.c
double div(double x,double y) { return x/y; }
int main() { double x; x = div(1.0,0.0); printf("%f\n",x); }
walton 14% gcc -o a a.c
walton 15% ./a
Floating exception (core dumped)
There was a discussion on one of the list about what to do for
floating point excpetions recently, and I thought people decided
that causing a signal by default was a right thing? I presume this
was caused by the commit below?
David.
cracauer 2000/03/10 09:56:33 PST
Modified files:
sys/i386/include npx.h
Log:
Change the default FPU control word so that exceptions for new
processes are now masked until set by fpsetmask(3).
Submitted by: bde
Approved by: jkh, bde
Revision Changes Path
1.18 +5 -35 src/sys/i386/include/npx.h
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003210847.aa00165>
