Skip to content

Commit b2a102f

Browse files
committed
Fix double floating point error in dtoa.c
When running an optimized build, compiler optimizations cause loss of precision unless we force the expression to use a double type.
1 parent f9f976b commit b2a102f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strings/dtoa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ static double ratio(Bigint *a, Bigint *b)
12901290
dval(&db)= b2d(b, &kb);
12911291
k= ka - kb + 32*(a->wds - b->wds);
12921292
if (k > 0)
1293-
word0(&da)+= k*Exp_msk1;
1293+
word0(&da)+= k*Exp_msk1 * 1.0;
12941294
else
12951295
{
12961296
k= -k;

0 commit comments

Comments
 (0)