You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/28 20:07:58 UTC

[GitHub] [incubator-nuttx] fjpanag opened a new issue, #6945: Wrong result with strtod().

fjpanag opened a new issue, #6945:
URL: https://github.com/apache/incubator-nuttx/issues/6945

   `strtod()` can produce wrong results in some cases of invalid input.
   
   Take a look at the following snippet:
   
   ```c
       char * str = "1e";
       char * end;
       
       int ret = strtod(str, end);
       
       printf("%d\n", ret);
   
   ```
   
   On my Linux machine, this prints `0`, while on NuttX it prints `1`.
   
   It seems that when the exponent is not correctly parsed, it is assumed to be 0 instead of returning an error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] acassis closed issue #6945: Wrong result with strtod().

Posted by GitBox <gi...@apache.org>.
acassis closed issue #6945: Wrong result with strtod().
URL: https://github.com/apache/incubator-nuttx/issues/6945


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] fjpanag commented on issue #6945: Wrong result with strtod().

Posted by GitBox <gi...@apache.org>.
fjpanag commented on issue #6945:
URL: https://github.com/apache/incubator-nuttx/issues/6945#issuecomment-1229548246

   Also the following strings seem to fail:
   
   `"1.0e+"`  
   `"."`  
   `"  "`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org