exp(-inf)

Scott Davies scottd@cs.cmu.edu
Thu Aug 31 08:54:00 GMT 2000


Hi --

I recently got bitten by the following behavior: when compiled
unoptimized, exp(-inf) = 0 (which is what I would hope for), but
with optimization turned on (-O), the inlined version of exp
returns exp(-inf) = nan.  (This is on a Pentium-class machine
with egcs-2.91.66.)

Would this be considered a bug or a feature?  (I suppose someone may
have decided that this case isn't worth dealing with since doing so
would slow down the "common case"...)

Thanks,

-- Scott


More information about the Gcc-bugs mailing list