(j3.2006) IEEE comparisons

Robert Corbett robert.corbett
Tue Aug 23 01:58:37 EDT 2016


On 8/22/2016 12:17 AM, Cohen Malcolm wrote:
> I do not think this is a problem, because the Fortran standard already
> handles this in the way you prefer, viz
>
>    "if the operands have different types or kind type parameters, the effect
> is as if each operand that differs in type or kind type parameter from those
> of the result is converted to the type and kind type parameter of the result
> before the operation is performed"
>
> therefore multiple exceptions are already permitted.  That is, because of
> that sentence, we never invoke the mixed-format versions of the IEEE
> comparisons, only the same-format versions.

I think the text you meant to quote is in paragraphs6 and 7
(which should be one paragraph) of Subclause 7.1.5.5.1 of
of 16-007r1.  That text states

       In the numeric relational operation

             /x_1 rel-op x_2 /

       if the types or kind type parameters of x_1 and x_2
       differ, their values are converted to the type and
       kind type parameter of the expression x_1 + x_2
       before evaluation.

I do not propose any change to that text (aside from fixing
the paragraph numbering).

Subclause 5.6.1 of ISO/IEC/IEEE 60559:2011 states

       Implementations shall provide the following
comparison operations, for all supported
       floating-point operands of the same radix in
       arithmetic formats:

Subclause 5.11 states

       Additionally, floating-point data represented
       in different formats shall be comparable as
       long as the operands' formats have the same
       radix.

I intend to provide edits to modify the comparison
functions specifiedin Clause 14 of 16-007r1 to
satisfy those requirements.Please let me know if
that change is unacceptable.

I spoke with David Hough today(Monday).  He said that
the IEEE Std. 754 committee will be meeting this coming
Friday and that my questions about comparisons are on
the agenda.  I hope to have answers to my questions soon.

Bob Corbett

> Cheers,
>
> -----Original Message-----
> From: Robert Corbett
> Sent: Tuesday, August 16, 2016 3:08 PM
> To: j3 at j3-fortran.org
> Subject: (j3.2006) IEEE comparisons
>
> While working on my paper concerning the IEEE relational
> operators and predicate functions, I noticed some flaws
> in IEEE Std. 754:2008.  Most of them are irrelevant for
> Fortran, but one is a potential problem.
>
> The current wording of the standard indicates that the
> comparison operations should generate at most one exception.
> That is fine for comparisons when the operands have the
> same format, but it is a problem when the operands have
> different formats.  The arithmetic operands have similar
> issues, but the standard explicitly allows the arithmetic
> operations to be implemented as a sequence of other
> operations.  The standard makes no such allowance for the
> comparison operations.  I see how to implement comparisons
> so that they conform to the current version of the
> standard, but at a significant cost in performance.
>
> I asked David Hough to take up the question of whether the
> inhomogenous comparison operations can signal more than once
> with the IEEE committee.  He thinks it is likely, but not
> certain, that the committee will decide that the operations
> can signal more than once.
>
> I found one of the issues addressed in the errata for
> IEEE Std. 745:2008 amusing.  Suppose a program includes an
> edit descriptor for producing one decimal digit under an
> E format.  What value should be printed for the internal
> value 95.0 under the round-to-nearest-even rounding mode?
>
> Bob Corbett
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star.
> ________________________________________________________________________
>




More information about the J3 mailing list