(j3.2006) IEEE comparisons
Robert Corbett
robert.corbett
Tue Aug 16 02:08:56 EDT 2016
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
More information about the J3
mailing list