From 672378fabe6bdf62211a48f9bcde8a44ba430d13 Mon Sep 17 00:00:00 2001 From: fdai7930 Date: Fri, 9 Feb 2024 13:58:36 +0100 Subject: [PATCH] Refactoring: removed multiplication by five function (a*5) --- src/multiplication.c | 4 +--- src/multiplication.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/multiplication.c b/src/multiplication.c index 037d396..d5eff30 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -21,9 +21,7 @@ int multi_left_shift(int a, int b) { int multi_right_shift(int a, int b) { return a >> b; } -int multi_by_five(int a) { - return a * 5; -} + float multi_by_percentage(float num, float percentage) { return num * (percentage / 100); diff --git a/src/multiplication.h b/src/multiplication.h index a607f71..713e205 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -5,7 +5,7 @@ extern double multi(double num1, double num2); int multi_three_integers(int a, int b, int c); int multi_left_shift(int a, int b); int multi_right_shift(int a, int b); -int multi_by_five(int a); + float multi_by_percentage(float num, float percentage); int multi_by_random(int num); int multi_string(const char* str, int factor);