msvcrt: Fix bugs in math.c
Piotr Caban
piotr.caban at gmail.com
Sun Mar 22 07:32:01 CDT 2015
Hi,
On 03/22/15 12:28, 陈正 wrote:
> - Fixed the problem of atan(INF)/tanh(INF)/exp(INF) causing errno EDOM
> - Fixed the error of _copysign(1., -0.) returning 1
Please don't send unrelated changes in one patch, please split it into 2
patches.
The changes that remove errno setting from atan, tanh and exp looks good
for me.
> float CDECL MSVCRT__copysignf( float num, float sign )
> {
> - /* 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;
> }
Why don't you add an isnan() check? Is there any reason for returning
"signbit(num) ? -num : num" instead of returning num?
It would be nice to also change signbit definition on systems that
doesn't support it, so it at least works for normal numbers.
Thanks,
Piotr
More information about the wine-devel
mailing list