Bug in sin(3.1415926535897931)
Apparently this is a gcc libquadmath bug, and nothing to do with mingw-w64. (I'll therefore close this report if I can wotk out how to.) I have lodged a bug report about this issue with gcc's bugzilla at: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94756 Cheers, Rob
With my 32-bit mingw-w64 port of gcc-8.1.0, I still experience this issue iff optimization is enabled. There's no problem with the 64-bit port. Here's the demo : #include <stdio.h> #include <math.h> int main(void) { double x = 1e-320; if(isnormal(x)) printf("wtf\n"); else printf("ok\n"); printf("%x\n", fpclassify(x)); printf("%x\n", __fpclassify(x)); /* printf("%x\n", __builtin_fpclassify(x)); *//* error */ } When built without optimization it correctly outputs: ok 4400 4400 But when built with O1...
It's also the same result with 8.1.0. However, as a workaround, calling __mingw_strtold() instead of strtold() works fine on 8.1.0. I haven't checked whether the same workaround is successful with earlier versions of gcc, but I'm hopeful that it does. Cheers, Rob
As a workaround, it's simply a matter of calling __mingw_strtold() instead of strtold(). Cheers, Rob
Respectively they are 5, 0, and non-existent. (I believe I have runtime version 5.0.2 - which, UIM, was the last runtime to not specify a "BUGFIX" value .) I agree that this is a duplicate of bug 459. Good to hear that it has been fixed in Master.
"%a" and "%La" formatting seriously broken
I've just noticed that something similar (and perhaps related) is happening for strings that are written in scientific notation. For example, although strtold("1e4956", NULL) correctly returns "inf", strtold("1e4957", NULL) returns zero. As I keep incrementing the exponent, the returned value remains "0" until we reach strtold("1e4978", NULL) when we start to get correct returns of "inf" again. Cheers, Rob