exp(-100.)=-.43e34 on IRIS
Glenn Randers-Pehrson, WMB
glennrp at BRL.ARPA
Thu Jul 7 22:52:49 AEST 1988
The behaviour of the EXP() function for large negative numbers on the
IRIS is shameful. I've tried the following program on a number of
machines (VAX f77, Gould f77, Alliant FORTRAN, Cray-2 cft77) and all
return 0.0 for out-of-range negative numbers. The IRIS returns
not-a-number if the floating point board isn't used. Worse, if the
floating point board is used it returns wrong numbers. This on a 3130
running 3.5r2 and a 2500T running 3.6.
program bugexp
dimension trial(10)
data trial/-1., -20., -50., -80., -85., -88.02968, -88.02970,
& -100., -1000., -10000/
do 10 i=1,10
x=trial(i)
xx=exp(x)
write(*,'('' exp('',f13.6,'')='',g15.8)')x,xx
10 continue
stop
end
Results with f77 -Zf:
exp( -1.000000)= .36787950
exp( -20.000000)= .20611540E-08
exp( -50.000000)= .19287500E-21
exp( -80.000000)= .18048510E-34
exp( -85.000000)= .12160990E-36
exp( -88.029680)= .15974800E-42
exp( -88.029700)=???????????????
exp( -100.000000)= -.43075530E+34
exp( -1000.000000)= .12234650E+29
exp(-10000.000000)= .41732680E-27
Programmed STOP
More information about the Comp.sys.sgi
mailing list