fix a bug of strtold

if input is -1e308,The output should be -100000000......
  but the output is -inf
This commit is contained in:
lilei19 2023-02-06 18:45:37 +08:00 committed by Xiang Xiao
parent 79704620f8
commit de21025702

View File

@ -401,12 +401,10 @@ static long_double decfloat(FAR char *ptr, FAR char **endptr)
else if (num_digit + num_decimal > ldbl_max_10_exp) else if (num_digit + num_decimal > ldbl_max_10_exp)
{ {
errno = ERANGE; errno = ERANGE;
return ldbl_max * ldbl_max;
} }
else if (num_digit + num_decimal < ldbl_min_10_exp) else if (num_digit + num_decimal < ldbl_min_10_exp)
{ {
errno = ERANGE; errno = ERANGE;
return ldbl_min * ldbl_min;
} }
if (k % 9) if (k % 9)