Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1627 NAN not recognized by strtod()

WSL
closed
Earnie Boyd
None
Bug
fixed
Feature_in_WSL_4.0
False
2013-02-25
2012-02-22
mik
No

Since mingwrt-3.19 strtod() no longer accepts a NAN string as a quiet NaN:

% cat > nan.c << __EOF && gcc -std=c99 nan.c -lm && ./a.exe
#include <math.h>
#include <stdlib.h>
#include <stdio.h>

int main()
{
printf("strtod(NAN) = %f, nan('') = %f\n", strtod("NAN", NULL), nan(""));
return 0;
}
__EOF
strtod(NAN) = 0.000000, nan('') = nan

Discussion

  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    I think this has less to do with the mingwrt version than with the GCC version being used but it is still a bug in mingw runtime none the less.

     
  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    • assigned_to: nobody --> ir0nh34d
     
  • Earnie Boyd
    Earnie Boyd
    2012-08-04

    • assigned_to: ir0nh34d --> earnie
     
  • Earnie Boyd
    Earnie Boyd
    2012-08-06

    I can resolve strtod to __strtod() in the headers and while the result is better it still isn't correct. Could you or someone else correct the code in mingwex/gdtoa/strtodnrp.c to DTRT? Currently it returns an infinity result instead of a quite NaN result.

     
  • Earnie Boyd
    Earnie Boyd
    2012-08-08

    FYI __strtod() from mingwex now DTRT. I will resolve an issue with the header related to this soon.

     
  • Earnie Boyd
    Earnie Boyd
    2012-10-30

    • labels: 104601 --> WSL (Windows System Libraries)
    • milestone: --> Feature_in_WSL_4.0
    • status: open --> closed-fixed
     
  • Earnie Boyd
    Earnie Boyd
    2012-10-30

    The up and coming release contains a resolution.

     
  • Earnie Boyd
    Earnie Boyd
    2013-01-18

    • category: --> Feature_in_WSL_4.0
    • milestone: Feature_in_WSL_4.0 --> WSL
     
  • Earnie Boyd
    Earnie Boyd
    2013-02-16

    • labels: WSL (Windows System Libraries) --> release notes
    • status: closed-fixed --> closed
    • type: --> Bug
    • resolution: --> fixed
    • patch_attached: --> False
     
  • Earnie Boyd
    Earnie Boyd
    2013-02-24

    • labels: release notes --> release notes, locate change
     
  • Earnie Boyd
    Earnie Boyd
    2013-02-25

    • labels: release notes, locate change -->
     
  • Earnie Boyd
    Earnie Boyd
    2013-02-25

    Notes added to NEWS file.

    Note: This change was made before combining mingwrt and w32api into one source bed. The ChangeLog entry resides in doc/historical/mingw/ChangeLog.