3
3
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4
4
/* SPDX-License-Identifier: Unlicense */
5
5
6
- static mp_word s_mp_flog2_mp_word (mp_word value )
6
+ static mp_word s_mp_flog2_mp_word_d (mp_word value )
7
7
{
8
8
mp_word r = 0u ;
9
9
while ((value >>= 1 ) != 0u ) {
@@ -13,12 +13,12 @@ static mp_word s_mp_flog2_mp_word(mp_word value)
13
13
}
14
14
15
15
/* Fixed point bitwise logarithm base two of "x" with precision "p" */
16
- static mp_err s_mp_fp_log_fraction (mp_word x , int p , mp_word * c )
16
+ static mp_err s_mp_fp_log_fraction_d (mp_word x , int p , mp_word * c )
17
17
{
18
18
mp_word b , L_out , L , a_bar , twoep ;
19
19
int i ;
20
20
21
- L = s_mp_flog2_mp_word (x );
21
+ L = s_mp_flog2_mp_word_d (x );
22
22
23
23
if ((L + (mp_word )p ) > MP_UPPER_LIMIT_FIXED_LOG ) {
24
24
return MP_VAL ;
@@ -60,14 +60,14 @@ mp_err s_mp_fp_log_d(const mp_int *a, mp_word *c)
60
60
if ((err = mp_div_2d (a , la - prec , & t , NULL )) != MP_OKAY ) goto LTM_ERR ;
61
61
tmp = mp_get_u64 (& t );
62
62
/* Compute the low precision approximation for the fractional part */
63
- if ((err = s_mp_fp_log_fraction (tmp , prec , & la_word )) != MP_OKAY ) goto LTM_ERR ;
63
+ if ((err = s_mp_fp_log_fraction_d (tmp , prec , & la_word )) != MP_OKAY ) goto LTM_ERR ;
64
64
/* Compute the integer part and add it */
65
65
tmp = ((mp_word )(la - prec ))<<prec ;
66
66
la_word += tmp ;
67
67
mp_clear (& t );
68
68
} else {
69
69
tmp = mp_get_u64 (a );
70
- if ((err = s_mp_fp_log_fraction (tmp , prec , & la_word )) != MP_OKAY ) {
70
+ if ((err = s_mp_fp_log_fraction_d (tmp , prec , & la_word )) != MP_OKAY ) {
71
71
return err ;
72
72
}
73
73
}
0 commit comments