From 3460453ea892b826fb92c68777fedfb743ad6f29 Mon Sep 17 00:00:00 2001 From: fdai7930 Date: Thu, 8 Feb 2024 12:01:13 +0100 Subject: [PATCH] multiplication by euler prime added --- src/multiplication.c | 4 ++++ src/multiplication.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/multiplication.c b/src/multiplication.c index e5d98cf..af39497 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -187,6 +187,10 @@ int multiply_exponentiation(int base, int exponent) { return result; } +int multiply_by_euler_prime(int num) { + return (num << 1) + (num << 2) - num; +} + diff --git a/src/multiplication.h b/src/multiplication.h index 8c42303..eefb4ff 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -25,6 +25,7 @@ int multiply_recursive_optimized(int num1, int num2); int multiply_octal_numbers(int num1, int num2); int multiply_hex_numbers(int num1, int num2); int multiply_exponentiation(int base, int exponent); +int multiply_by_euler_prime(int num); #endif // MULTIPLICATION_H