Skip to content

Commit 503ae69

Browse files
committed
Cleanup
1 parent 6556571 commit 503ae69

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

ext/bcmath/libbcmath/src/raisemod.c

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,8 @@
3737
#include "bcmath.h"
3838
#include "private.h"
3939

40-
41-
/* Truncate a number to zero scale. To avoid sharing issues (refcount and
42-
shared n_value) the number is copied, this copy is truncated, and the
43-
original number is "freed". */
44-
45-
static void
46-
_bc_truncate (bc_num *num)
47-
{
48-
bc_num temp;
49-
50-
temp = bc_new_num ((*num)->n_len, 0);
51-
temp->n_sign = (*num)->n_sign;
52-
memcpy (temp->n_value, (*num)->n_value, (*num)->n_len);
53-
bc_free_num (num);
54-
*num = temp;
55-
}
56-
57-
58-
/* Raise BASE to the EXPO power, reduced modulo MOD. The result is
59-
placed in RESULT. If a EXPO is not an integer,
60-
only the integer part is used. */
61-
62-
int
63-
bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
40+
/* Raise BASE to the EXPO power, reduced modulo MOD. The result is placed in RESULT. */
41+
int bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
6442
{
6543
bc_num power, exponent, modulus, parity, temp;
6644
int rscale;

0 commit comments

Comments
 (0)