Browse Source

Refactoring: removed all functions countain square

remotes/origin/multiplication
fdai7930 12 months ago
parent
commit
54501c1c09
  1. 8
      src/multiplication.c
  2. 4
      src/multiplication.h

8
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;

4
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);

Loading…
Cancel
Save