(j3.2006) IEEE comparisons

Cohen Malcolm malcolm
Mon Aug 22 03:17:44 EDT 2016


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.

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.
________________________________________________________________________

-- 
........................Malcolm Cohen, Nihon NAG, Tokyo. 




More information about the J3 mailing list