Sun FPU question

David Hough dgh%dgh at Sun.COM
Mon Mar 6 11:31:41 AEST 1989


The default mode of ANSI/IEEE 754 and 854 arithmetic is non-stop:
floating-point exceptions (inexact, underflow, overflow, division by
zero, invalid operand) set flags and produce standard default
results, but computation is not terminated or interrupted.
Programs that are written with IEEE arithmetic in mind generally
find that the default results are appropriate.
All general-purpose implementations provide some kind of alternative
that allows selective trapping on any or all of the exceptions.
On Suns running SunOS 4.0 or later, see ieee_handler(3m).

Since the default allows one to run through all kinds of trouble
in a buggy program without termination, I provided a retrospective
message at the end of Fortran programs compiled under Fortran 1.1
or later.  This message to standard error informs you that some
of the IEEE exceptions occurred and the status flags weren't reset.

I described the Sun implementation tersely in a Floating-Point
Programmer's Guide Addendum which was somewhat obscured in the
SunOS 4.0 documentation crate by being included in the 
Software Read This First - Programmer's Guides Minibox
part number 800-1789.


David Hough

dhough at sun.com   
na.hough at na-net.stanford.edu
{ucbvax,decvax,decwrl,seismo}!sun!dhough



More information about the Comp.lang.c mailing list