From 1e59489b4d0b3e912fa13ef54de2d47ba1bedd50 Mon Sep 17 00:00:00 2001 From: fdai7930 Date: Thu, 8 Feb 2024 15:25:32 +0100 Subject: [PATCH] added another e to bitwise --- src/multiplication.c | 6 +++++- src/multiplication.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/multiplication.c b/src/multiplication.c index d6ba3fa..398b12e 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -219,7 +219,7 @@ float power_multi(float base, int exponent) { return result; } -int bitwise_multi(int num1, int num2) { +int bitwisee_multi(int num1, int num2) { int result = 0; while (num1) { if (num1 & 1) { @@ -255,6 +255,10 @@ int karatsuba_multi(int num1, int num2) { return ac * (int)pow(10, 2 * m2) + ad_bc * (int)pow(10, m2) + bd; } +int multiply_by_riesel_prime(int num) { + return (num << 2) + (num << 3) - (num << 1) - num; +} + diff --git a/src/multiplication.h b/src/multiplication.h index 2e9abdb..547ebe3 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -30,8 +30,9 @@ int fibonacci_multi(int num, int fib); int repeated_division_multi(int num1, int num2); int bernoulli_multi(int num, int bernoulli); float power_multi(float base, int exponent); -int bitwise_multi(int num1, int num2); +int bitwisee_multi(int num1, int num2); int karatsuba_multi(int num1, int num2); +int multiply_by_riesel_prime(int num);