Sun FPU question
Ethan Brown
ethan at esosun.UUCP
Sun Mar 5 08:22:48 AEST 1989
In article <10660 at pasteur.Berkeley.EDU> faustus at dogwood.Berkeley.EDU (Wayne A. Christopher) writes:
Path: esosun!seismo!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!dogwood.Berkeley.EDU!faustus
From: faustus at dogwood.Berkeley.EDU (Wayne A. Christopher)
Newsgroups: comp.lang.c
Date: 3 Mar 89 22:58:15 GMT
Sender: news at pasteur.Berkeley.EDU
Lines: 6
It seems that on some Suns, the FPU by default doesn't signal
divide-by-zero errors, but makes the result Inf or NaN. Is there a way
to make it give a floating point error? Does gcc have a flag for
this? How about the MIPS compiler, which has the same behavior?
Wayne
Wayne:
I found similar problems on a Sun 4 when testing a FORTRAN program I'm
currently working on. After the program terminated (normally, by the
way) I got some warnings about IEEE exceptions raised but not cleared.
It seems that only SOME of the IEEE exceptions cause program
termination.
There are some manual sections explaining how to set up your own
IEEE exception handler (c.f. f77_ieee_environment.3f (there is probably
an equivalent entry for C)) that were very helpful. After becoming familiar
with the IEEE exception handling functions you should be able to trap
your divide-by-zero conditions.
Hope this helps,
More information about the Comp.lang.c
mailing list