Floating Point Problem ffast-math Complex divide
Ron Young
ronyoung@adelphia.net
Thu Oct 20 22:00:00 GMT 2005
The following floating point complex divide doesn't work with -ffast-math.
A real divide with the same numbers works. It seems like I have had trouble
with this for more than 6 months, so maybe it was partly fixed, but not
with -ffast-math.
program cdevtest
real*8 rj1,rjq,rscale
complex*16 j1,jq,scale
rj1=-.166d0
rjq=-1.195d-277
rscale=rj1/rjq
write(6,*)rscale,rj1,rjq
j1=(-.166d0,0.)
jq=(-1.195d-277,0.)
scale=j1/jq
write(6,*)scale,j1,jq
end
This works correctly with Intel and Pathscale compilers.
The new -ffpe-trap options are really going to help find these problems.
Thanks Ron Young
More information about the Fortran
mailing list