[J3] Several mistakes in EXPONENT
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Tue Jan 26 13:58:17 UTC 2021
Sorry for the line noise. Bob Corbett pointed out that I was reading the section on EXPONENT but I was consistently interpreting it EXP in my head (and in my test programs).
Nothing to see here.
What I had been trying to find was where, if anywhere, the standard specifies the results for intrinsics when one or more arguments are NaN. E.g., MAXVAL, MAX, EXP, etc. After searching for NaN in the document, it appears that the results are only indirectly defined in reference to other IEEE documents. If there is an explicit clause summarizing such issues, I would appreciate it if someone could point me to the location.
Thans,
* Tom
From: "Clune, Thomas L. (GSFC-6101)" <thomas.l.clune at nasa.gov>
Date: Tuesday, January 26, 2021 at 8:22 AM
To: J3 List <j3 at j3-fortran.org>
Subject: Several mistakes in EXPONENT
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/d606aa5a/attachment-0001.htm>
More information about the J3
mailing list