Browse Source

power multiplication fonction added

remotes/origin/multiplication
fdai7930 11 months ago
parent
commit
6590afc699
  1. 10
      src/multiplication.c
  2. 2
      src/multiplication.h

10
src/multiplication.c

@ -206,11 +206,19 @@ int repeated_division_multiply(int num1, int num2) {
} }
return result; return result;
} }
int bernoulli_multiply(int num, int bernoulli) { int bernoulli_multiply(int num, int bernoulli) {
return num * bernoulli; return num * bernoulli;
} }
float power_multiply(float base, int exponent) {
float result = 1.0;
for (int i = 0; i < exponent; i++) {
result *= base;
}
return result;
}

2
src/multiplication.h

@ -29,7 +29,7 @@ int multiply_by_euler_prime(int num);
int fibonacci_multiply(int num, int fib); int fibonacci_multiply(int num, int fib);
int repeated_division_multiply(int num1, int num2); int repeated_division_multiply(int num1, int num2);
int bernoulli_multiply(int num, int bernoulli); int bernoulli_multiply(int num, int bernoulli);
float power_multiply(float base, int exponent);

Loading…
Cancel
Save