From e1c962683b2588501603225eddcf2ce4d26a4379 Mon Sep 17 00:00:00 2001 From: fdai7930 Date: Wed, 7 Feb 2024 23:27:51 +0100 Subject: [PATCH] multiplication right shift --- src/multiplication.c | 3 +++ src/multiplication.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/multiplication.c b/src/multiplication.c index 1b3717e..58f1e8e 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -17,6 +17,9 @@ int multiply_three_integers(int a, int b, int c) { int multiply_left_shift(int a, int b) { return a << b; } +int multiply_right_shift(int a, int b) { + return a >> b; +} diff --git a/src/multiplication.h b/src/multiplication.h index c4fdd6b..0a77b5a 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -4,6 +4,7 @@ extern double multi(double ein1, double ein2); double square(double x); int multiply_three_integers(int a, int b, int c); int multiply_left_shift(int a, int b); +int multiply_right_shift(int a, int b); #endif // MULTIPLICATION_H