SWI-Prolog has released a new release 8.5.20 with better
float rounding. Comparing we found:
/* SWI-Prolog 8.5.20 Ok */
?- X is float(166153499473114502559719956244594689).
X = 1.6615349947311452e+35.
/* Ciao Prolog Nok */
?- X is float(166153499473114502559719956244594689).
X = 1.661534994731145e35 ?
Our guess is that this conversion routine doesn't work
for HALF_EVEN mode:
flt64_t bn_to_float(bignum_t *bn) {
while (i > 1) {
f = f*norm2 + u;
https://github.com/ciao-lang/ciao/blob/master/core/engine/eng_bignum.c#L1043
SWI-Prolog has released a new release 8.5.20 with better float rounding. Comparing we found:
Our guess is that this conversion routine doesn't work for HALF_EVEN mode: