Skip to content

Commit

Permalink
math: Fix undefined behavior in exp10()
Browse files Browse the repository at this point in the history
  • Loading branch information
jart authored and nsz-arm committed May 22, 2024
1 parent 39fed85 commit 88ffd2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion math/exp10.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ exp10 (double x)
Approximate the two components separately. */

/* s = 2^(k/N), using lookup table. */
uint64_t e = ki << (52 - EXP_TABLE_BITS);
uint64_t e = (uint64_t)ki << (52 - EXP_TABLE_BITS);
uint64_t i = (ki & IndexMask) * 2;
uint64_t u = __exp_data.tab[i + 1];
uint64_t sbits = u + e;
Expand Down

0 comments on commit 88ffd2e

Please sign in to comment.