Date: Tue, 3 Feb 1998 09:07:00 -0800 (PST) From: Tom Bartol <bartol@salk.edu> To: freebsd-questions@FreeBSD.ORG Subject: Re: IEEE Floating Point question: Inf and NaN (fwd) Message-ID: <Pine.BSF.3.96.980203090615.25791C-100000@dale.salk.edu>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980203090615.25791C-100000>