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.
Log in to post a comment.