(j3.2006) (SC22WG5.5780) edits to clarify SQRT treatment of negative zero, for comments
Anton Shterenlikht
mexas
Tue Aug 23 12:00:53 EDT 2016
Dear WG5/J3
Below is a draft of my paper to J3.
I wanted to post it here for comments first.
This has been discussed in COMP-FORTRAN-90,
the thread starts at:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind1608&L=comp-fortran-90&F=&S=&P=1866
Anton
****************************
To: J3 J3/16-xxx
From: Anton Shterenlikht
Subject: clarification of SQRT text regarding minus zero
Date: 23-JUL-2016
Reference: J3/16-007r1
Discussion:
-----------
Description of SQRT, [424:6-8], does not "explicitly"
mention that negative zero is distinguished, on processors
which distinguish positive and negative zero.
According to [56:21-25] this means that positive
and negative zero actual arguments are treated
as mathematically equivalent by SQRT.
This is wrong because LOG does distinguish positive
and negative zero [394:31-395:3], and SQRT(X)
is mathematically equivalent to EXP( 0.5 * LOG(X) ).
Also [424:6-7], the word "principal" in the sentence
"A result of type complex is the principal value with
the real part greater or equal to zero." seems redundant,
as "principal" in this context means precisely "with
the real part greater or equal to zero".
I suggest to replace some text under SQRT Result Value,
and make it very similar to that of LOG with regards to
minus zero.
Edits to J3/16-007r1:
---------------------
Replace the last 2 sentences of
[424:5-8 13.9.182p5] with
"A result of type complex
is the value with the real part
greater than or equal to zero.
If the real part of X is less
than zero and the imaginary
part of X is zero, then the
imaginary part of the result is
positive if the imaginary part of X
is positive real zero or the
processor does not distinguish
between positive and negative zero,
and negative if the imaginary
part of X is negative real zero."
More information about the J3
mailing list