diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 8377a0d..037ed94 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -13,4 +13,7 @@ float cube(float x); // Function to calculate the cube root of a number float cubeRoot(float x); +// Function to calculate the absolute value of a number +float absolute(float x); + #endif \ No newline at end of file diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 26c8030..0f0b22c 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -32,4 +32,9 @@ void test_cubeRoot(void) { // Add more test cases for different inputs and expected outputs } +void test_absolute(void) { + float result = absolute(-5.0); + TEST_ASSERT_EQUAL_FLOAT(5.0, result); +} + #endif \ No newline at end of file