(j3.2006) the IEEE modules and distinguishing zero values
Craig Dedo
craig
Wed Nov 16 17:04:10 EST 2011
> -----Original Message-----
> From: j3-bounces at j3-fortran.org [mailto:j3-bounces at j3-fortran.org] On Behalf Of
> Fred J. Tydeman
> Sent: Wednesday, November 16, 2011 14:13
> To: fortran standards email list for J3
> Subject: Re: (j3.2006) the IEEE modules and distinguishing zero values
>
> On Wed, 16 Nov 2011 17:53:35 +0900 Malcolm Cohen wrote:
> >
> >Alternatively it is evidence that people didn't care about *distinguishing them*.
> >
> >That is quite different from having the values in themselves and following the IEC
> 60559 rules in arithmetic. No-one is arguing about that - clearly that is
> required, since it is actually stated!
>
> In looking at N1830.pdf (ISO/IEC 1539-1:2010), it is not clear to me if
>
> (-0.0) ** (-1)
> (-0.0) ** (-1.0)
>
> are required, allowed, or prohibited from being -infinity for IEEE-754 (IEC 60559)
> implementations.
>
> ---
> Fred J. Tydeman Tydeman Consulting
> <mailto:tydeman at tybor.com> 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> http://www.tybor.com Savers sleep well,
investors eat well,
> spenders work forever.
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?.
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 checked my copy of IEC 60559:1989 and it is silent on the operations that
you mention above. Therefore, if a Fortran processor claims conformance with IEC
60559:1989, it can compute any result that it pleases.
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?.
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.
Hope this helps. Please feel free to contact me at any time with any
questions or concerns that you may have. I am looking forward to hearing from you soon.
Sincerely,
Craig T. Dedo
17130 W. Burleigh Place
P. O. Box 423 Mobile Phone: (414) 412-5869
Brookfield, WI 53008-0423 E-mail: < <mailto:craig at ctdedo.com> craig at ctdedo.com>
USA
Linked-In: <http://www.linkedin.com/in/craigdedo> http://www.linkedin.com/in/craigdedo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20111116/09063067/attachment.html>
More information about the J3
mailing list