xiaoxiang781216 commented on code in PR #7724: URL: https://github.com/apache/nuttx/pull/7724#discussion_r1034875948
########## libs/libc/stdlib/lib_strtof.c: ########## @@ -82,6 +83,34 @@ static inline int is_real(float x) return (x < infinite) && (x >= -infinite); } +int chtof(char c, float base, FAR float *number) +{ + /* This function is to determine if c is keyword + * Then set number + base + */ + + if (isdigit(c) || (c >= 'A' && c <= 'F') + || (c >= 'a' && c <= 'f')) + { + if (isdigit(c)) + { + *number = *number * base + (double)(c - '0'); + } + else if (c >= 'A' && c <= 'F') + { + *number = *number * base + (double)(c - '7'); + } + else Review Comment: else fi (c >= 'a' && c <= 'f') -- 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