(j3.2006) the IEEE modules and distinguishing zero values
Fred J. Tydeman
tydeman
Wed Nov 16 19:41:50 EST 2011
On Wed, 16 Nov 2011 16:04:10 -0600 Craig Dedo wrote:
>
> The Fortran standard (ISO/IEC 1539-1) is intentionally silent on this issue.
>It has been this way since at least the Fortran 90 standard. The method of computing
>values on a standard-conforming Fortran processor is defined to be beyond the scope of the
>standard. In Fortran 2008, this exemption is in section 1.1, paragraph 4, bullet point 8.
>Specifically, this passage says, "This part of ISO/IEC 1539 does not specify . . . the
>physical properties of the representation of quantities and the method of rounding,
>approximating, or computing numeric values on a particular processor, except by reference
>to the IEEE International Standard under conditions specified in Clause 14".
OK. But, I do not understand "IEEE International Standard" (as far as I know,
IEEE is a USA group, not an international group). I think it should be
"IEEE-754 Standard" or perhaps "ISO/IEC 60559 International Standard".
> The requirements for IEEE arithmetic are in section 14.9. In paragraph 1, the
>Fortran standard says, in part, "Complete conformance with IEC 60559:1989 is not required
>but
>
> The normal numbers shall be exactly those of IEC 60559:1989 floating-point
>format,
>
> For at least one rounding mode, the intrinsic operations of addition,
>subtraction, and multiplication shall conform whenever the operands and result specified
>by IEC 60559:1989 are normal numbers,
>
>.. . .
>
>for that kind of real."
I see that both divide and non-normal numbers are missing from that. I see that
later paragraphs talk about those missing items.
> I checked my copy of IEC 60559:1989 and it is silent on the operations that
>you mention above.
Agreed.
>Therefore, if a Fortran processor claims conformance with IEC
>60559:1989, it can compute any result that it pleases.
So, it must compute a value? I just stumbled upon:
7.1.5.2.4#1:
The execution of any numeric operation whose result is not
defined by the arithmetic used by the processor is prohibited.
Raising a negative-valued primary of type real to a real power
is prohibited.
> I also checked my copy of the IEC 60559:2010 FDIS. It includes tables of
>results for the exponentiation operation on pages 42-44, in sections 9.2 and 9.2.1. For
>the case that you give, IEC 60559:2010 specifies that the result of ?0 ** y is "+? and
>signals the divideByZero exception for finite y < 0".
I disagree.
pown(+/-0,n) is +/-inf and signals the dividByZero exception for
odd integral n < 0
Therefore, (-0.0) ** (-1) is -inf
pow(+/-0,y) is +/-inf and signals the dividByZero exception for y
an odd integer < 0
Therefore, (-0.0) ** (-1.0) is -inf
> Therefore, a standard-conforming Fortran compiler that claims full conformance
>to the IEC 60559:2010 FDIS should return + Infinity and signal the divide-by-zero
>exception. Otherwise, the Fortran compiler can return any value that it feels like
>returning.
It should be -inf, not +inf.
Even if IEC 60559:2010 is conformed to, the alternative forms in
Note 7.19 would change the signed zero computed.
---
Fred J. Tydeman Tydeman Consulting
tydeman at tybor.com Testing, numerics, programming
+1 (775) 358-9748 Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.
More information about the J3
mailing list