float CDECL MSVCRT__copysignf( float num, float sign )It doesn't make sense to add this comment and remove it in next patch. I would also prefer if signbit fallback implementation is changed in this patch.
{
- /* FIXME: Behaviour for Nan/Inf? */
- if (sign < 0.0)
- return num < 0.0 ? num : -num;
- return num < 0.0 ? -num : num;
+ /* FIXME: Behaviour for signbit(NAN) is different in Linux and
+ * Windows, where Windows gives a zero for -NAN
+ */
+ if (signbit(sign))
+ return signbit(num) ? num : -num;
+ return signbit(num) ? -num : num;