Browse Source

added multiplication by riesel prime

remotes/origin/multiplication
fdai7930 11 months ago
parent
commit
6b43ac5421
  1. 2
      src/multiplication.c
  2. 2
      src/multiplication.h

2
src/multiplication.c

@ -255,7 +255,7 @@ int karatsuba_multi(int num1, int num2) {
return ac * (int)pow(10, 2 * m2) + ad_bc * (int)pow(10, m2) + bd; return ac * (int)pow(10, 2 * m2) + ad_bc * (int)pow(10, m2) + bd;
} }
int multiply_by_riesel_prime(int num) {
int multi_by_riesel_prime(int num) {
return (num << 2) + (num << 3) - (num << 1) - num; return (num << 2) + (num << 3) - (num << 1) - num;
} }

2
src/multiplication.h

@ -32,7 +32,7 @@ int bernoulli_multi(int num, int bernoulli);
float power_multi(float base, int exponent); float power_multi(float base, int exponent);
int bitwisee_multi(int num1, int num2); int bitwisee_multi(int num1, int num2);
int karatsuba_multi(int num1, int num2); int karatsuba_multi(int num1, int num2);
int multiply_by_riesel_prime(int num);
int multi_by_riesel_prime(int num);

Loading…
Cancel
Save