Commit e35af662 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Workaround for dtoa.c

There is no obvious reason why multiplying by 1.0 helps solve a
precision problem on gcc-7 or clang-5, but it does work. Casting to
ulong however makes the problem come up again. Windows warns about loss
of precision, so to quiet warnings until an appropriate fix is
implemented, ifdef 2 versions of the code.
parent c5ac1f95
......@@ -1290,7 +1290,17 @@ static double ratio(Bigint *a, Bigint *b)
dval(&db)= b2d(b, &kb);
k= ka - kb + 32*(a->wds - b->wds);
if (k > 0)
word0(&da)+= (ULong)(k*Exp_msk1 * 1.0);
#ifdef _WIN32
word0(&da)+= k*Exp_msk1;
#else
/*
TODO(cvicentiu)
This is a temporary fix for a possible clang-5 / gcc-7 bug. This
should not be required but it makes double results in the end
be predictable.
*/
word0(&da)+= k*Exp_msk1 * 1.0;
#endif
else
{
k= -k;
......
Markdown is supported
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