Subject: Re: SIGFPE?
To: None <kre@munnari.OZ.AU, rauch@eecs.ukans.edu>
From: Ross Harvey <ross@ghs.com>
List: netbsd-help
Date: 05/04/2001 10:29:17
> From: Richard Rauch <rauch@eecs.ukans.edu>
:::
> > Thus, you get no SIGFPE from the division. You might get one later
> > from attempting to operate upon the result (perhaps - depends upon the
> > operation).
>
> I didn't know that IEEE specified that. Thanks.
Actually, you can get the SIGFPE, but you must enable it. See below.
:::
>
> So this is a documentation error?
:::
No, it's not a documentation error, you just haven't looked in the right
place and no one has yet referred you to it. You need to see:
fp{get,set}{mask,round,sticky}(3)
(They are all the same page.) These will work on every NetBSD port except
vax, I think, but they aren't portable to other systems except Sun and
Sun-compatible ones.
Somewhat sadly, NetBSD/vax doesn't have the include or the entry points,
nor does it solve the problem by defining a wrapper api common to all ports,
so fpsetmask(3) is kind of broken as a common API.
For that matter, IEEE 754 has gone 20 years without a standardized API.
(And hence, has gone 20 years without being used by any portable program.)
C99 has now defined a standard floating environment, and NetBSD will be
supporting it soon.
//