printer: ensure that we generate enough digits for floats

When the number of digits was not specified, we were sometimes
outputting a number that was exactly halfway between the exact value
and the next higher float. When reading that number in again, one
would get a different value due to rounding issues. Therefore, we now
always output enough digits, so that the number can be reconstructed
unambigously. Fixes #500.
This commit is contained in:
Marius Gerbershagen 2019-05-05 15:27:57 +02:00 committed by Daniel Kochmański
parent 8a82b9fcfb
commit aa5ed8bc7b

View file

@ -59,7 +59,7 @@ setup(cl_object number, float_approx *approx)
default:
break;
}
approx->low_ok = approx->high_ok = ecl_evenp(f);
approx->low_ok = approx->high_ok = 0;
if (e > 0) {
cl_object be = EXPT_RADIX(e);
if (limit_f) {