Paolo Bonzini wrote:
> I think ==, !=, isordered, isunordered comparisons are
> the sole operations you can safely perform on a SNaN.
Even these operations will trap on a SNaN, according to [1]:
Signaling NaNs shall be reserved operands that signal the invalid
operation exception (7.1) for
> So, your opinion about the following patch?
Ok; at the time i wrote mathl, there was (as you know)
no isnanl package.
I think ==, !=, isordered, isunordered comparisons are
the sole operations you can safely perform on a SNaN.
Paolo
Hi Paolo,
The mathl module uses the idiom x != x
to test for a NaN. The IRIX 6.5 cc compiler, however, simplifies this expression
to false, both for 'double' and 'long double' variables. The two workarounds
that I found are:
- Use the isnanl function,
- Copy one of the operands into a 'volat