<div dir="ltr">I've checked and the same happens with the signbit macro.<div><br></div><div>Victor</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 11:56 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Jun 6, 2014 at 2:51 PM, <a href="mailto:victor.zverovich@gmail.com">victor.zverovich@gmail.com</a><br>


<<a href="mailto:victor.zverovich@gmail.com">victor.zverovich@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> When compiling with a recent version of Clang, the following code<br>
><br>
>   std::signbit(-std::numeric_limits<double>::quiet_NaN())<br>
><br>
> returns true with optimizations disabled and false with optimizations<br>
> enabled. Other compilers like GCC and older versions of Clang always return<br>
> true as expected. Is it a bug or a feature?<br>
><br>
> I'm using Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn).<br>
<br>
</div></div>I believe this is likely a bug. std::signbit is defined to behave the<br>
same as the C macro of the same name, which has the footnote, "The<br>
signbit macro reports the sign of all values, including infinities,<br>
zeros, and NaNs. If zero is unsigned, it is treated as positive."<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span></blockquote></div><br></div>