xiaoxiang781216 commented on code in PR #7724: URL: https://github.com/apache/nuttx/pull/7724#discussion_r1035197707
########## libs/libc/stdlib/lib_strtod.c: ########## @@ -188,8 +223,16 @@ double strtod(FAR const char *str, FAR char **endptr) /* Process an exponent string */ - if (*p == 'e' || *p == 'E') + if (*p == 'e' || *p == 'E' || *p == 'p' || *p == 'P') Review Comment: does 0x must be paired with 'p'/'P' not 'e'/'E' ########## libs/libc/stdlib/lib_strtod.c: ########## @@ -80,6 +80,36 @@ static inline int is_real(double x) return (x < infinite) && (x >= -infinite); } +static bool chtod(char c, double base, FAR double *number) Review Comment: change line 72 return type to bool ########## libs/libc/stdlib/lib_strtod.c: ########## @@ -140,16 +170,22 @@ double strtod(FAR const char *str, FAR char **endptr) break; } + p10 = 10.; number = 0.; exponent = 0; num_digits = 0; num_decimals = 0; /* Process string of digits */ - while (isdigit(*p)) + if (*p == '0' && tolower(*(p + 1)) == 'x') Review Comment: add comment: ``` /* Process optional 0x prefix */ if (*p == '0' && tolower(*(p + 1)) == 'x') { } /* Process string of digits */ ``` -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org