<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Piotr,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">    It would be nice to also change signbit definition on systems that<br>    doesn't support it, so it at least works for normal numbers.<br><br>The signbit() function is actually part of C99, not my implementation,<br>so I think it should be supported on most systems? Though I am not quite<br>sure...<br></blockquote></span>It's not available when compiled with Visual Studio. There's following code in math.c:<br>    #ifndef signbit<br>    #define signbit(x) 0<br>    #endif<br>I think it would be better if it's at least changed to something like:<br>#define signbit(x) ((x)<0 ? 1 : 0)<br>It will not work correctly for -NAN or -0 but it will not break the cases where old implementation was working.<br></blockquote></span></div><div><br></div><div>Sorry I didn't notice my program in VS was linked to the C++ lib for this signbit() function.<br></div><div>"#define signbit(x) ((x)<0 ? 1 : 0)"  Looks good to me, I will submit a patch. Thanks for the advice :)<br></div><div class="gmail_extra"><div class="gmail_quote"><br></div></div></div></blockquote><div> </div><div>Just came to me that maybe we should include isnan() in signbit() instead of using isnan() in _copysign(), seems like that's how Windows does it.</div><div> </div><div>Thanks,</div><div>Zheng</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>