sqrtl behavior inconsistent with sqrt and sqrtf

Ken Brown kbrown@cornell.edu
Tue Oct 27 13:51:09 GMT 2020

On 10/27/2020 7:17 AM, airplanemath via Cygwin wrote:
> Compiling and running the attached program with the command line below
> produces the output below:
> $ gcc -O0 -Og test_sqrt.c -o test_sqrt && ./test_sqrt
> Long double: -inf -inf
> Double:      -inf -nan
> Float:       -inf -nan
> I suspect the behavior for long double should be the same as for double
> and float (sqrt(-inf) = nan), but I'm not sure where to change that.
> I'm running a snapshot of Cygwin 3.2.0, if that's important.

This is again a bug in the mingw-w64 math code that was imported into Cygwin. 
I'll send a fix to the cygwin-patches list.


More information about the Cygwin mailing list