Skip to content

Commit 3fd275f

Browse files
committed
Import optimized routines changes to exp10
1 parent 2045e87 commit 3fd275f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libc/tinymath/exp10.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ special_case (uint64_t sbits, double_t tmp, uint64_t ki)
4343
{
4444
double_t scale, y;
4545

46-
if (ki - (1ull << 16) < 0x80000000)
46+
if ((ki & 0x80000000) == 0)
4747
{
4848
/* The exponent of scale might have overflowed by 1. */
4949
sbits -= 1ull << 52;
@@ -109,14 +109,14 @@ exp10 (double x)
109109
/* Reduce x: z = x * N / log10(2), k = round(z). */
110110
double_t z = __exp_data.invlog10_2N * x;
111111
double_t kd;
112-
int64_t ki;
112+
uint64_t ki;
113113
#if TOINT_INTRINSICS
114114
kd = roundtoint (z);
115115
ki = converttoint (z);
116116
#else
117117
kd = eval_as_double (z + Shift);
118+
ki = asuint64 (kd);
118119
kd -= Shift;
119-
ki = kd;
120120
#endif
121121

122122
/* r = x - k * log10(2), r in [-0.5, 0.5]. */

0 commit comments

Comments
 (0)