Commit a2fb8de6 authored by Michael Beck's avatar Michael Beck
Browse files

fixed fc_val_from_str() do NOT produce values with more significant bits than requested in the mode

parent bd8f05b0
......@@ -1077,19 +1077,21 @@ done:
return result;
/* XXX excuse of an implementation to make things work */
LLDBL val;
char *tmp = alloca(calc_buffer_size);
(void) len;
val = strtold(str, NULL);
DEBUGPRINTF(("val_from_str(%s)\n", str));
fc_val_from_float(val, 15, 64, tmp);
val = strtod(str, NULL);
DEBUGPRINTF(("val_from_str(%s)\n", str));
return fc_val_from_float(val, exp_size, mant_size, result);
fc_val_from_float(val, 11, 52, tmp);
#endif /* HAVE_LONG_DOUBLE */
return fc_cast(tmp, exp_size, mant_size, result);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment