Eric Blake wrote:
> should we raise this as a gcc bug, that when it
> does constant-folding optimization of signbit at compile-time
> (signbit(-0.0) => 1), it results in a different value than when the macro
> is used on a runtime value (signbit(result) => mask off all but the sign bit)?

I don't think it's a bug. The spec
  http://www.opengroup.org/susv3/functions/signbit.html
does not specify which non-zero return value is used. You don't even have
the guarantee that two different invocations of signbit(x) with the same x
will yield the same results.

Things would be different if the return value was 'bool'. But it's 'int'.

Bruno



Reply via email to