From 54501c1c09f74b4038687465fed39ddaee29126d Mon Sep 17 00:00:00 2001 From: fdai7930 Date: Fri, 9 Feb 2024 13:53:28 +0100 Subject: [PATCH] Refactoring: removed all functions countain square --- src/multiplication.c | 8 ++------ src/multiplication.h | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/multiplication.c b/src/multiplication.c index c8dbe28..037d396 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -9,9 +9,7 @@ double multi( double num1, double num2) { return (num1 * num2); } -double square(double x) { - return x * x; -} + int multi_three_integers(int a, int b, int c) { return a * b * c; @@ -107,9 +105,7 @@ int multi_increment(int num1, int num2) { return result; } -int multi_by_prime_and_its_square(int num, int prime) { - return num * (prime + square (prime)); -} + int multi_by_odd(int num, int factor) { int result = 0; diff --git a/src/multiplication.h b/src/multiplication.h index cf2b1a1..a607f71 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -1,7 +1,7 @@ #ifndef MULTIPLICATION_H #define MULTIPLICATION_H extern double multi(double num1, double num2); -double square(double x); + 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); @@ -17,7 +17,7 @@ int multi_logical_op(int num1, int num2); int multi_modulo(int num1, int num2, int modulo); int multi_by_prime(int num, int prime); int multi_increment(int num1, int num2); -int multi_by_prime_and_its_square(int num, int prime); + int multi_by_odd(int num, int factor); int multi_binary_enumeration(int num1, int num2); int multi_differences(int num1, int num2);