From ebf0a3ae18909bf8decc5e746ad03e4768bfcdc5 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Tue, 6 Feb 2024 16:28:32 +0100 Subject: [PATCH 1/2] Removed float power function --- src/c/funktionen.c | 4 ---- src/c/funktionen.h | 2 -- src/test/test_funktionen.c | 4 ---- 3 files changed, 10 deletions(-) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index b1ba42c..35dda8e 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -53,10 +53,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 int factorial(int x) { diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 26f686a..f254fd6 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -22,8 +22,6 @@ float logarithm(float x); // Function to calculate the natural logarithm (base e) of a number 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 int factorial(int x); diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index db518d1..b0ed5bc 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -46,10 +46,6 @@ void test_naturalLogarithm(void) { 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) { int result = factorial(5); From b053fa88730db16f26da98e81cde8b454b0bf412 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Tue, 6 Feb 2024 16:50:19 +0100 Subject: [PATCH 2/2] Fixing a problem --- src/test/test_funktionen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 9718c02..71f0ef8 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -12,11 +12,6 @@ void tearDown(void) } -void test_1000_plus_1(void) -{ - /* arrange */ - int actual; - int expected = 1000; void test_square(void) { float result = square(2.5); @@ -95,6 +90,11 @@ void test_remainderValue(void) { TEST_ASSERT_FLOAT_WITHIN(0.000001, 1.5, result); } +void test_1000_plus_1(void) +{ + /* arrange */ + int actual; + int expected = 1000; /* act */ actual = addThreeNumbers(500, 249, 251);