On 01/16/2013 09:14 AM, Andreas Schwab wrote:
Mischa Baars <mjbaars1...@gmail.com> writes:

Furthermore, since 'fxam' will return a 'non-comparable' during the first
compare, I suppose the function should then enter the first 'else' and
return a '4'.
Non-comparable means that NaN != NaN is always true.

Andreas.

Sorry, let me correct, first I mean 'ftst' instead of 'fxam'.

This is the output of 'ftst' is according to the manual:

[C3 C2 C1 C0] := [1 1 x 1] when not-comparable (this is where the not-a-numbers go)
  [C3 C2 C1 C0] := [0 0 x 0] when st(0) > 0
  [C3 C2 C1 C0] := [0 0 x 1] when st(0) < 0
  [C3 C2 C1 C0] := [1 0 x 0] when st(0) = 0

This means that the first 'if' statement should have been terminated when one or both of the arguments is a QNaN, entering the 'else' would be in error. Also the second 'if' statement shouldn't be evaluated. This should also be true when the first 'if' is not enclosed by any 'isnan()'.

Furthermore, the manual states that any operation on a QNaN should return a QNaN.

Correct?


Reply via email to