> On Wed, 15 Aug 2018, Masamichi Hosoda wrote: > >> On Linux with glibc, both strtod ("nan") >> and strtod ("-nan") return positive NaN. >> >> So I've created the patch that behaves like glibc. >> Both strtod ("nan") and strtod ("-nan") return positive NaN. > > I would suggest that you should not consider fixed bugs in glibc (bug > 23007 in this case) to be appropriate to emulate in other libraries. I've create the patch that behaves to preserve the sign bit. The result on Cygwin 64 bit (newlib, x86_64) with the patch: ``` strtof ("nan", NULL) = nan strtof ("-nan", NULL) = -nan strtod ("nan", NULL) = nan strtod ("-nan", NULL) = -nan strtold ("nan", NULL) = nan strtold ("-nan", NULL) = -nan ``` Thank you for your suggestion.