Hello Martin,

thanks for pointing us on this. There is a regression for sqrt on

values classify(x) != NaN and x<-0. I prefer the following

implementation more, as we avoid to split the if.

if (x_class == FP_NAN || signbit (x))

{

if (x_class == FP_ZERO)

return **FLT_CST (-0.0);
if ( x_class == FP_NAN )
{
**FLT_RPT_DOMAIN ("sqrt", x, 0.0, x);

return x;

}

res = -

**FLT_NAN;**

FLT_RPT_DOMAIN ("sqrt", x, 0.0, res);

return res;

}

Regards,

Kai

2016-10-15 16:42 GMT+02:00 Martin Whitaker martinwhitaker@users.sf.net:

[bugs:#567] sqrt() no longer returns NaN for x less than -0

Status: open

Group: v1.0 (example)

Created: Sat Oct 15, 2016 02:42 PM UTC by Martin Whitaker

Last Updated: Sat Oct 15, 2016 02:42 PM UTC

Owner: nobody

Attachments:sqrt.patch (656 Bytes; text/x-patch)

Using an old version of mingw-w64 (last updated May 2015), calling

sqrt(-1.0) would return NaN (the expected result). After updating to the

current version, it returns -1.0.It looks like this bug was introduced by commit 6617eb.

The attached (untested) patch would likely fix it.

Sent from sourceforge.net because you indicated interest in

https://sourceforge.net/p/mingw-w64/bugs/567/To unsubscribe from further messages, please visit

https://sourceforge.net/auth/subscriptions/