[cfe-dev] signbit returns false for negative NaN

victor.zverovich at gmail.com victor.zverovich at gmail.com
Fri Jun 6 11:51:27 PDT 2014


Hello,

When compiling with a recent version of Clang, the following code

  std::signbit(-std::numeric_limits<double>::quiet_NaN())

returns true with optimizations disabled and false with
optimizations enabled. Other compilers like GCC and older versions of Clang
always return true as expected. Is it a bug or a feature?

I'm using Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn).

Thanks,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140606/8760f257/attachment.html>


More information about the cfe-dev mailing list