HELP! Need Decent RS6000 Fortran Compiler!
Jukka Korpela
jkorpela at vipunen.hut.fi
Fri May 10 18:04:48 AEST 1991
This is a brief summary of what I've found so far (thnx to all who sent
me mail 'bout the problems) about arithmetics on RS/6000:
- the default handling of almost all arithmetic errors (I guess integer
divide by zero is the only exception - it generates core dump...)
is to ignore them; but floating point errors do behave in the IEEE
way, and a numeric variable who's value is infinity or NaN is
printed out as "INF" or "NaNQ" or something like that
- peculiarly, if you want to test within a program whether the value
of X is NaN, X.NE.X seems to be the (undocumented) way; there are
probably ways of detecting infinities as well
- using the (documented, but poorly documented) routines FPGETS and
FPSETS you can detect if floating-point errors have occurred
- but you probably can't really trap them; even in C, you can't use
the standardized tools; I tried to trap SIGFPE and the result is
that a) 1.0/0.0 doesn't generate a trap, it simply produces INF,
b) if I call fp_enable_all, 1.0/0.0 still doesn't generate a trap,
but it produces 1.0 !!!
- errors in math routines (well, actually, more or less invalid args to
them, like SQRT(-1.0) or EXP(1E30)) do not necessarily (usually?) set
FPE flags on (understandable), so you can't use FPGETS to see if they;
you CAN use matherr, but it's designed to be C callable, so you need
a simple interface routine
I'm not happy with the situation, but at least I can tell our users how
they can (and should!) insert a small piece of code to make their program
report floating-point errors ***somehow***.
More information about the Comp.unix.aix
mailing list