Closed mateusz-bloch closed 4 months ago
When the string to be converted by strtod(), strtof(), strtold() has a hexadecimal value, the conversion does not proceed correctly
strtod()
strtof()
strtold()
#include <stdio.h> #include <stdlib.h> int main (void) { char str[] = "0X1.FFFFFEP-127"; float strtof_output = strtof(str, NULL); double strtod_output = strtod(str, NULL); long double strtold_output = strtold(str, NULL); printf("%f\n", strtof_output); printf("%lf\n", strtod_output); printf("%Lf\n", strtold_output); return 0; }
Duplicate of https://github.com/phoenix-rtos/phoenix-rtos-project/issues/657
When the string to be converted by
strtod()
,strtof()
,strtold()
has a hexadecimal value, the conversion does not proceed correctly