From owner-freebsd-questions Tue Feb 3 09:07:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA25727 for questions-outgoing; Tue, 3 Feb 1998 09:07:09 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from helmholtz.salk.edu (helmholtz.salk.edu [198.202.70.34]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA25587 for ; Tue, 3 Feb 1998 09:07:02 -0800 (PST) (envelope-from bartol@salk.edu) Received: from dale.salk.edu (dale [198.202.70.112]) by helmholtz.salk.edu (8.7.5/8.7.3) with SMTP id JAA07134 for ; Tue, 3 Feb 1998 09:07:01 -0800 (PST) Date: Tue, 3 Feb 1998 09:07:00 -0800 (PST) From: Tom Bartol To: freebsd-questions@FreeBSD.ORG Subject: Re: IEEE Floating Point question: Inf and NaN (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe questions" On Tue, 3 Feb 1998, Jonathan Lemon wrote: > > __BETTER_BDE_NPXCW__ changes the operation of the floating point hardware > so that by default it masks overflow, zero divide, and invalid operand > exceptions. The current behavior of the system is to leave all of these > exceptions unmasked and let the programmer deal with them. It does the > same thing as fpsetmask(), except you'll have to re-compile the kernel > and you won't be guaranteed the same behavior on another system. > > Question: I don't think think that that fpsetmask man page has enough > cross-references to it, otherwise you would probably have found it > on your own. Which man pages do you feel should have had a cross- > reference to fpsetmask? > -- > Jonathan Thanks for the answer! Yes, I suspected there must be some way to adjust the floating point exception policy on the system. Guessing that it was some kind of system-wide policy I checked "man sysctl" and then guessing that it was a run-time policy I checked "man math" but got no cross-reference to fpsetmask. It seems like the best place for a cross-reference would be in the math manpage (sysctl was a wild-ass-guess on my part). The fpsetmask call is actually a very important thing to know about and one area where the FreeBSD team should be quite proud. As a programmer, it's great to have this kind of control over how these exceptions are handled. After learning about this call I'm convinced that the system default of trapping the exception and stopping execution is the correct system-wide policy (it is conducive to the writing of good code in general). Tom