[J3] Several mistakes in EXPONENT

Clune, Thomas L. (GSFC-6101) thomas.l.clune at nasa.gov
Tue Jan 26 13:22:44 UTC 2021


While investigating a tangential question from Damian,   I came across the following sentence in 18-007r1 in the specs for the EXPONENT intrinsic:

(p368, lines 35-36):  “If X has the value zero, the result has the value zero. If X is an IEEE infinity or NaN, the result has the value
HUGE (0).”

Problems:

  1.  EXP(0)  should be 1 (not 0)
  2.  EXP(Inf) should be Inf  (not HUGE(0))
  3.  EXP(-Inf) should be 0 (not HUGE(0))
  4.  EXP(NaN) should be NaN  (not HUGE(0))
  5.  Even if HUGE were relevant its argument should be FP of the appropriate precision, not a default integer with value 0.

I’ve confirmed with 2 compilers that my expectations are sound.    However, I have not scoured the other intrinsics to look for similar problems.

Presumably there should be a paper?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210126/43e994d6/attachment.htm>


More information about the J3 mailing list