> "A result of type complex is the principal value
> with the real part greater than or equal to zero."
Sorry I missed that.
I read a bit more. I note that Sec. 1.6.5 [27:14-16]
says that f2008 differs from f95 when the processor
distinguishes between positive and negative zero.
Perhaps some vendors provide switches to use f95 or f08 behaviour.
Perhaps this explains my different results with different compilers.
However...
I might be completely wrong, but I understand that
the whole point of having +0 and -0
is that the branch cut is now "between" +pi and -pi.
Hence the description of LOG(X), Sec. 13.9.118 [394:32],
now has "...the principal value with imaginary part omega
in the range -pi <= omega <= pi."
There is the equality sign on both sides.
The ability to distinguish -pi from +pi comes from
the ability to distinguish +0 and -0.
So when the processor can distinguish +0 and -0,
then the imaginary part of
log( cmplx( -4.0, -0.0 ) ) must be -pi (approx.)
and the imaginary part of
log( cmplx( -4.0, 0.0 ) ) must be pi (approx.)
both being the *principal* values.
So I wonder whether in the presence of +0 and -0
both branches of SQRT become principal.
Am I completely wrong?
Perhaps I need to read IEEE 754 to better
understand the consequences of +0 and -0.
Anton
|