Browse Source

Merge branch 'Abdelrahman'

Removed function 'power'
remotes/origin/siamak
Abdelrahman 11 months ago
parent
commit
378dfd3a5e
  1. 4
      src/c/funktionen.c
  2. 2
      src/c/funktionen.h
  3. 4
      src/test/test_funktionen.c

4
src/c/funktionen.c

@ -235,10 +235,6 @@ return 0;
} }
} }
// Function to calculate the exponentiation of a number to the power of another number
float power(float x, float y) {
return pow(x, y);
}
// Function to calculate the factorial of a number // Function to calculate the factorial of a number
int factorial(int x) { int factorial(int x) {

2
src/c/funktionen.h

@ -103,8 +103,6 @@ float logarithm(float x);
// Function to calculate the natural logarithm (base e) of a number // Function to calculate the natural logarithm (base e) of a number
float naturalLogarithm(float x); float naturalLogarithm(float x);
// Function to calculate the exponentiation of a number to the power of another number
float power(float x, float y);
// Function to calculate the factorial of a number // Function to calculate the factorial of a number
int factorial(int x); int factorial(int x);

4
src/test/test_funktionen.c

@ -53,10 +53,6 @@ void test_naturalLogarithm(void) {
TEST_ASSERT_FLOAT_WITHIN(0.000001, 4.60517, result); TEST_ASSERT_FLOAT_WITHIN(0.000001, 4.60517, result);
} }
void test_power(void) {
float result = power(2.0, 3.0);
TEST_ASSERT_FLOAT_WITHIN(0.000001, 8.0, result);
}
void test_factorial(void) { void test_factorial(void) {
int result = factorial(5); int result = factorial(5);

Loading…
Cancel
Save