From fac379793f88999635a4f0fbc4d2cc95a3f6683e Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 15:44:26 +0100 Subject: [PATCH 01/93] =?UTF-8?q?Hinzuf=C3=BCgen=20neuer=20Bibliotheken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/c/funktionen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 6747445..b5ee404 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -1,2 +1,4 @@ #include +#include +#include #include "funktionen.h" From bffbcdb84f37647e2878bb18fbbe2c7fe2400294 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 15:58:57 +0100 Subject: [PATCH 02/93] square funktion --- src/c/funktionen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index b5ee404..e2b2251 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -2,3 +2,10 @@ #include #include #include "funktionen.h" + +// Function to calculate the square of a number +float square(float x) { +return x * x; +} + + From 8cba48a694de22b2fc17a44ba06c78c4d47740f1 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 15:59:36 +0100 Subject: [PATCH 03/93] square funktion header --- src/c/funktionen.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 248f2f8..a00e3f3 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -1,6 +1,7 @@ #ifndef FUNKTIONEN_H #define FUNKTIONEN_H - +// Function to calculate the square of a number +float square(float x); #endif \ No newline at end of file From 4b31f40819337a484f0a6f734cb929b9f8641e8e Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:01:24 +0100 Subject: [PATCH 04/93] square funktion test --- src/test/test_funktionen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 0729a16..9ea83ab 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -11,6 +11,10 @@ void tearDown(void) { } +void test_square(void) { + float result = square(2.5); + TEST_ASSERT_EQUAL_FLOAT(6.25, result); +} #endif \ No newline at end of file From 5aeb57ca5691226d87644ada60a87bfba91cc40b Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:08:13 +0100 Subject: [PATCH 05/93] squareroot funktion --- src/c/funktionen.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index e2b2251..ba5383b 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -8,4 +8,13 @@ float square(float x) { return x * x; } +float squareRoot(float x) { +if (x >= 0) { +return sqrt(x); +} else { +printf("Error: Invalid input for square root!\n"); +return 0; +} +} + From 12ff346eff1ada528f8426b8fbda4c0e3ac9876d Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:10:23 +0100 Subject: [PATCH 06/93] squareroot funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index a00e3f3..6f517c5 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -4,4 +4,7 @@ // Function to calculate the square of a number float square(float x); +// Function to calculate the square root of a number +float squareRoot(float x); + #endif \ No newline at end of file From 6a914e846596d1866696b6b34e92322e5a2209bb Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:11:03 +0100 Subject: [PATCH 07/93] squareroot funktion test --- src/test/test_funktionen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 9ea83ab..3c10c4b 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -16,5 +16,9 @@ void test_square(void) { TEST_ASSERT_EQUAL_FLOAT(6.25, result); } +void test_squareRoot(void) { + float result = squareRoot(9.0); + TEST_ASSERT_EQUAL_FLOAT(3.0, result); +} #endif \ No newline at end of file From d8aedd1eba57bd78d123f0b92ceab13a6406ed4a Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:14:38 +0100 Subject: [PATCH 08/93] cube funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index ba5383b..79e25b5 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -17,4 +17,9 @@ return 0; } } +// Function to calculate the cube of a number +float cube(float x) { +return x * x * x; +} + From 99a6f721d62431cc45fabfafd12571d1235f8a85 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:15:05 +0100 Subject: [PATCH 09/93] cube funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 6f517c5..767df58 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -7,4 +7,7 @@ float square(float x); // Function to calculate the square root of a number float squareRoot(float x); +// Function to calculate the cube of a number +float cube(float x); + #endif \ No newline at end of file From 512520d23ffd0290d0e4ac9346579833617bc04d Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:15:42 +0100 Subject: [PATCH 10/93] cube funktion test --- src/test/test_funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 3c10c4b..a49ef97 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -21,4 +21,9 @@ void test_squareRoot(void) { TEST_ASSERT_EQUAL_FLOAT(3.0, result); } +void test_cube(void) { + float result = cube(2.0); + TEST_ASSERT_EQUAL_FLOAT(8.0, result); +} + #endif \ No newline at end of file From ff8ee0efe79f23b6043316981636d0a5240e0606 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:20:03 +0100 Subject: [PATCH 11/93] cuberoot funktion --- src/c/funktionen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 79e25b5..40d41d3 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -22,4 +22,7 @@ float cube(float x) { return x * x * x; } - +// Function to calculate the cube root of a number +float cubeRoot(float x) { +return cbrt(x); +} From 1d9828d5b223de77a40ca26f5baa07401f827be2 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:20:20 +0100 Subject: [PATCH 12/93] cuberoot funktion hearder --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 767df58..8377a0d 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -10,4 +10,7 @@ float squareRoot(float x); // Function to calculate the cube of a number float cube(float x); +// Function to calculate the cube root of a number +float cubeRoot(float x); + #endif \ No newline at end of file From b1d255fee6b1e8af6ae7fab43ded2f22ebdf9b83 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 16:20:49 +0100 Subject: [PATCH 13/93] cuberoot funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index a49ef97..26c8030 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -26,4 +26,10 @@ void test_cube(void) { TEST_ASSERT_EQUAL_FLOAT(8.0, result); } +void test_cubeRoot(void) { + float result = cubeRoot(27.0); + TEST_ASSERT_EQUAL_FLOAT(3.0, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 5bd7a8228ff6db812fd7a63b13c202d7fdd59ceb Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 19:54:45 +0100 Subject: [PATCH 14/93] sine funktion --- src/c/funktionen.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index c1ba980..92f25aa 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -1,4 +1,7 @@ #include +#include +#include +#include #include "funktionen.h" void welcome() { @@ -75,4 +78,9 @@ int characterAppearanceInString(char c, char string[]) { } return appear; +} + +// Function to calculate the sine of an angle in radians +float sine(float x) { + return sin(x); } \ No newline at end of file From bc639743bcd555b9c02f6401f95560c7f410ba94 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 19:55:23 +0100 Subject: [PATCH 15/93] sine funktion header --- src/c/funktionen.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 506d703..40067b4 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -34,4 +34,9 @@ int string_character_counter(char string[]); int characterAppearanceInString(char c, char string[]); // liefert die Anzahl an einem bestimmten Character in einem String zurueck + +// Function to calculate the sine of an angle in radians +float sine(float x); + + #endif \ No newline at end of file From 19ead45f3b8e517abd5a01f30b02b3179637a028 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 19:55:49 +0100 Subject: [PATCH 16/93] sine funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 37852c4..28ea824 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -137,4 +137,10 @@ void test_howManyTimes_e_appearsIn_Beere(void) TEST_ASSERT_EQUAL_INT(expected, actual); } + +void test_sine(void) { + float result = sine(0.5); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 0.479426, result); +} + #endif \ No newline at end of file From b92941d197ff319197467c8d89bb6e4022ce84fd Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:13:04 +0100 Subject: [PATCH 17/93] test sine funktion version 2 --- src/test/test_funktionen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 28ea824..3f9817b 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -140,7 +140,7 @@ void test_howManyTimes_e_appearsIn_Beere(void) void test_sine(void) { float result = sine(0.5); - TEST_ASSERT_FLOAT_WITHIN(0.000001, 0.479426, result); + TEST_ASSERT_EQUAL_FLOAT(0.479426, result); } #endif \ No newline at end of file From 7b09b34e0203eede22cc09b3c7c7ed869f405333 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:23:43 +0100 Subject: [PATCH 18/93] cosine Funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 92f25aa..682bf23 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -83,4 +83,9 @@ int characterAppearanceInString(char c, char string[]) { // Function to calculate the sine of an angle in radians float sine(float x) { return sin(x); +} + +// Function to calculate the cosine of an angle in radians +float cosine(float x) { + return cos(x); } \ No newline at end of file From fe032b9509f27f8dd708cbc19ac5b5aac8fe4c06 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:24:36 +0100 Subject: [PATCH 19/93] cosine Funktion --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 40067b4..ae99a8c 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -38,5 +38,8 @@ int characterAppearanceInString(char c, char string[]); // Function to calculate the sine of an angle in radians float sine(float x); +// Function to calculate the cosine of an angle in radians +float cosine(float x); + #endif \ No newline at end of file From 2254de3bcff051492847fae9c37c71fc9b309c88 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:26:59 +0100 Subject: [PATCH 20/93] cosine Funktion test --- src/test/test_funktionen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 3f9817b..67e690f 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -143,4 +143,11 @@ void test_sine(void) { TEST_ASSERT_EQUAL_FLOAT(0.479426, result); } +void test_cosine(void) { + float result = cosine(1.0); + TEST_ASSERT_EQUAL_FLOAT(0.540302, result); + // Add more test cases for different inputs and expected outputs +} + + #endif \ No newline at end of file From 0100fa823d7375c0d6ba5ce6bca4850bc0e1b30a Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:32:56 +0100 Subject: [PATCH 21/93] absolute funktion --- src/c/funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 40d41d3..b762515 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "funktionen.h" // Function to calculate the square of a number @@ -26,3 +27,8 @@ return x * x * x; float cubeRoot(float x) { return cbrt(x); } + +// Function to calculate the absolute value of a number +float absolute(float x) { +return fabs(x); +} From fcd302eee44840b88070c3be2ea854bd1259c16a Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:34:31 +0100 Subject: [PATCH 22/93] tangent Funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 682bf23..49c9fa5 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -88,4 +88,9 @@ float sine(float x) { // Function to calculate the cosine of an angle in radians float cosine(float x) { return cos(x); +} + +// Function to calculate the tangent of an angle in radians +float tangent(float x) { + return tan(x); } \ No newline at end of file From fda57e8d0c4eae22a3d46f556edd028a97cad6ec Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:34:45 +0100 Subject: [PATCH 23/93] absolute funktion test --- src/c/funktionen.h | 3 +++ src/test/test_funktionen.c | 5 +++++ 2 files changed, 8 insertions(+) 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 From 8727d2d5ceed85b445598966485c28e85cae14d9 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:35:39 +0100 Subject: [PATCH 24/93] tangent Funktion Header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index ae99a8c..6c17885 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -41,5 +41,8 @@ float sine(float x); // Function to calculate the cosine of an angle in radians float cosine(float x); +// Function to calculate the tangent of an angle in radians +float tangent(float x); + #endif \ No newline at end of file From 4d4b4f726708ff5a4225b312680856aa713fa3d3 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:36:31 +0100 Subject: [PATCH 25/93] tangent Funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 67e690f..beeee75 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -149,5 +149,11 @@ void test_cosine(void) { // Add more test cases for different inputs and expected outputs } +void test_tangent(void) { + float result = tangent(1.5); + TEST_ASSERT_EQUAL_FLOAT(14.101419, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 9a2f6e2161617e6933ca0d2cf1571a6678803ff8 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:43:35 +0100 Subject: [PATCH 26/93] arcSine --- src/c/funktionen.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 49c9fa5..1908340 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -93,4 +93,15 @@ float cosine(float x) { // Function to calculate the tangent of an angle in radians float tangent(float x) { return tan(x); -} \ No newline at end of file +} + +// Function to calculate the arc sine of a value and return the result in radians +float arcSine(float x) { + if (x >= -1 && x <= 1) { + return asin(x); + } + else { + printf("Error: Invalid input for arc sine!\n"); + return 0; + } +} From d4af25db0f40c21c4fcfd1e5a67d56317b686ad7 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:44:05 +0100 Subject: [PATCH 27/93] logarithm funktion --- src/c/funktionen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index b762515..6ec9a84 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -32,3 +32,13 @@ return cbrt(x); float absolute(float x) { return fabs(x); } + +// Function to calculate the logarithm (base 10) of a number +float logarithm(float x) { +if (x > 0) { +return log10(x); +} else { +printf("Error: Invalid input for logarithm!\n"); +return 0; +} +} From e55a7044b98b7bb3612f65368aaa5ce7dcad8e20 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:44:06 +0100 Subject: [PATCH 28/93] arcSine --- src/c/funktionen.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 6c17885..28d875e 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -44,5 +44,7 @@ float cosine(float x); // Function to calculate the tangent of an angle in radians float tangent(float x); +// Function to calculate the arc sine of a value and return the result in radians +float arcSine(float x); #endif \ No newline at end of file From ff2ad41f4eb10f87eb0a6fb21ada5ad2d3754379 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:44:44 +0100 Subject: [PATCH 29/93] logarithm funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 037ed94..fa73c03 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -16,4 +16,7 @@ float cubeRoot(float x); // Function to calculate the absolute value of a number float absolute(float x); +// Function to calculate the logarithm (base 10) of a number +float logarithm(float x); + #endif \ No newline at end of file From 44aad658839b98098ae52965bf074255ea92cf6e Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:45:42 +0100 Subject: [PATCH 30/93] arcSine Funktion test --- src/test/test_funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index beeee75..4cef254 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -155,5 +155,10 @@ void test_tangent(void) { // Add more test cases for different inputs and expected outputs } +void test_arcSine(void) { + float result = arcSine(0.5); + TEST_ASSERT_EQUAL_FLOAT(0.523599, result); + // Add more test cases for different inputs and expected outputs +} #endif \ No newline at end of file From 269428aa8cc076967395512d3383bc8e1944c3f8 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:46:24 +0100 Subject: [PATCH 31/93] lograrithm funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 0f0b22c..39eb3d5 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -37,4 +37,10 @@ void test_absolute(void) { TEST_ASSERT_EQUAL_FLOAT(5.0, result); } +void test_logarithm(void) { + float result = logarithm(100.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 2.0, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 389b6b0b09f911e81e6c01f982293c2967336d9f Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:52:22 +0100 Subject: [PATCH 32/93] log_base_e Funktion --- src/c/funktionen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 6ec9a84..6cc0436 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -42,3 +42,13 @@ printf("Error: Invalid input for logarithm!\n"); return 0; } } + +// Function to calculate the natural logarithm (base e) of a number +float naturalLogarithm(float x) { +if (x > 0) { +return log(x); +} else { +printf("Error: Invalid input for natural logarithm!\n"); +return 0; +} +} From ee40cb151d855da3a1306bb0ef53ab7544410cb3 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:53:00 +0100 Subject: [PATCH 33/93] log_base_e Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index fa73c03..1401fde 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -19,4 +19,7 @@ float absolute(float x); // Function to calculate the logarithm (base 10) of a number float logarithm(float x); +// Function to calculate the natural logarithm (base e) of a number +float naturalLogarithm(float x); + #endif \ No newline at end of file From b87f0a2713724b8220bdab985936bfeef0504b55 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:53:34 +0100 Subject: [PATCH 34/93] log_base_e Funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 39eb3d5..97e9ceb 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -43,4 +43,10 @@ void test_logarithm(void) { // Add more test cases for different inputs and expected outputs } +void test_naturalLogarithm(void) { + float result = naturalLogarithm(100.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 4.60517, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 20c0d62f833946847c29831126e86aba7c5784ba Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:53:48 +0100 Subject: [PATCH 35/93] arcCosine Funktion --- src/c/funktionen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 1908340..ccb752f 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -105,3 +105,15 @@ float arcSine(float x) { return 0; } } + +// Function to calculate the arc cosine of a value and return the result in radians +float arcCosine(float x) { + if (x >= -1 && x <= 1) { + return acos(x); + } + else { + printf("Error: Invalid input for arc cosine!\n"); + return 0; + } +} + From 28b5eadf39e5c0582c5e57f1168834086139da47 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:54:09 +0100 Subject: [PATCH 36/93] arcCosine Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 28d875e..02a0618 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -47,4 +47,7 @@ float tangent(float x); // Function to calculate the arc sine of a value and return the result in radians float arcSine(float x); +// Function to calculate the arc cosine of a value and return the result in radians +float arcCosine(float x); + #endif \ No newline at end of file From a08fdfba2befe4fc86a33456ca22e962fddd1524 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:54:38 +0100 Subject: [PATCH 37/93] arcCosine Funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 4cef254..15f80dd 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -161,4 +161,10 @@ void test_arcSine(void) { // Add more test cases for different inputs and expected outputs } +void test_arcCosine(void) { + float result = arcCosine(0.5); + TEST_ASSERT_EQUAL_FLOAT(1.047198, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 8e81097101870c4003390f5f418afc6f9542946d Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:59:59 +0100 Subject: [PATCH 38/93] power Funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 6cc0436..8c8f0d2 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -52,3 +52,8 @@ printf("Error: Invalid input for natural logarithm!\n"); 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); +} From 45bd020c5133aa6990f2eea0c95ac906eeaa36a4 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:00:14 +0100 Subject: [PATCH 39/93] arcTangent Funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index ccb752f..456aac5 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -117,3 +117,8 @@ float arcCosine(float x) { } } +// Function to calculate the arc tangent of a value and return the result in radians +float arcTangent(float x) { + return atan(x); +} + From 6d751ea40ca94174d0689b90ab2de8a1e147b0f4 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:00:25 +0100 Subject: [PATCH 40/93] power Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 1401fde..e8b0d08 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -22,4 +22,7 @@ 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); + #endif \ No newline at end of file From 4259ce63e80a8d965c94b5dee58e307cd155c95a Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:00:29 +0100 Subject: [PATCH 41/93] arcTangent Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 02a0618..b6e14ed 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -50,4 +50,7 @@ float arcSine(float x); // Function to calculate the arc cosine of a value and return the result in radians float arcCosine(float x); +// Function to calculate the arc tangent of a value and return the result in radians +float arcTangent(float x); + #endif \ No newline at end of file From e1f71ece6c24c220018e92969d10fdf8b9a84d7e Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:01:03 +0100 Subject: [PATCH 42/93] power Funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 97e9ceb..4423ae8 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -49,4 +49,10 @@ void test_naturalLogarithm(void) { // Add more test cases for different inputs and expected outputs } +void test_power(void) { + float result = power(2.0, 3.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 8.0, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 8bff7262a62afa059564f737e562cab48b564928 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:01:04 +0100 Subject: [PATCH 43/93] arcTangent Funktion test --- src/test/test_funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 15f80dd..fc41a9b 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -167,4 +167,9 @@ void test_arcCosine(void) { // Add more test cases for different inputs and expected outputs } +void test_arcTangent(void) { + float result = arcTangent(1.0); + TEST_ASSERT_EQUAL_FLOAT(0.785398, result); + // Add more test cases for different inputs and expected outputs +} #endif \ No newline at end of file From 30fa69497e5c8865accd3a8a62347943d122da40 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:07:21 +0100 Subject: [PATCH 44/93] factorial Funktion --- src/c/funktionen.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 8c8f0d2..bffcaeb 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -57,3 +57,17 @@ return 0; float power(float x, float y) { return pow(x, y); } + +// Function to calculate the factorial of a number +int factorial(int x) { +if (x >= 0) { +int result = 1; +for (int i = 1; i <= x; i++) { +result *= i; +} +return result; +} else { +printf("Error: Invalid input for factorial!\n"); +return 0; +} +} From 7c0acfe34432d335dbcf99aa15834b258c24d47f Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:07:40 +0100 Subject: [PATCH 45/93] factorial Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index e8b0d08..7a45053 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -25,4 +25,7 @@ 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); + #endif \ No newline at end of file From ea34141d3cc72b6d65b4c6b2e441a0ec45f30318 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:09:10 +0100 Subject: [PATCH 46/93] factorial Funktion test --- src/test/test_funktionen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 4423ae8..b0f2bd4 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -55,4 +55,11 @@ void test_power(void) { // Add more test cases for different inputs and expected outputs } +void test_factorial(void) { + int result = factorial(5); + TEST_ASSERT_EQUAL_INT(120, result); + // Add more test cases for different inputs and expected outputs +} + + #endif \ No newline at end of file From 8e243066253cd20c06a27c2b55589015e2f6d0cc Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:09:38 +0100 Subject: [PATCH 47/93] degreesToRadians --- src/c/funktionen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 456aac5..d741c2b 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -122,3 +122,7 @@ float arcTangent(float x) { return atan(x); } +// Function to convert degrees to radians +float degreesToRadians(float x) { + return x * (M_PI / 180); +} From 2a61fbc11f8ae9f991a99c5a5357557722b2baf8 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:09:50 +0100 Subject: [PATCH 48/93] degreesToRadians header --- src/c/funktionen.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index b6e14ed..54c545a 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -53,4 +53,6 @@ float arcCosine(float x); // Function to calculate the arc tangent of a value and return the result in radians float arcTangent(float x); +// Function to convert degrees to radians +float degreesToRadians(float x); #endif \ No newline at end of file From 0be98a04006864b26b0a461996b0e2d109cb36ff Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:10:20 +0100 Subject: [PATCH 49/93] degreesToRadians test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index fc41a9b..6630381 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -172,4 +172,10 @@ void test_arcTangent(void) { TEST_ASSERT_EQUAL_FLOAT(0.785398, result); // Add more test cases for different inputs and expected outputs } + +void test_degreesToRadians(void) { + float result = degreesToRadians(90.0); + TEST_ASSERT_EQUAL_FLOAT(1.570796, result); + // Add more test cases for different inputs and expected outputs +} #endif \ No newline at end of file From a4856692e6fb5d52fd6ff703ffeaafb63afa743f Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:21:27 +0100 Subject: [PATCH 50/93] radiansToDegrees --- src/c/funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index d741c2b..b069db3 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -126,3 +126,9 @@ float arcTangent(float x) { float degreesToRadians(float x) { return x * (M_PI / 180); } + +// Function to convert radians to degrees +float radiansToDegrees(float x) { + return x * (180 / M_PI); +} + From 4a337d4a43896fc363c66efdb5648454c948d4a9 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:21:38 +0100 Subject: [PATCH 51/93] radiansToDegrees header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 54c545a..9726659 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -55,4 +55,7 @@ float arcTangent(float x); // Function to convert degrees to radians float degreesToRadians(float x); + +// Function to convert radians to degrees +float radiansToDegrees(float x); #endif \ No newline at end of file From 794ed24928ec7ea1b1deedd2a24d9a412cb281d0 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:22:52 +0100 Subject: [PATCH 52/93] radiansToDegrees test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 6630381..d6546dc 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -178,4 +178,10 @@ void test_degreesToRadians(void) { TEST_ASSERT_EQUAL_FLOAT(1.570796, result); // Add more test cases for different inputs and expected outputs } + +void test_radiansToDegrees(void) { + float result = radiansToDegrees(1.570796); + TEST_ASSERT_EQUAL_FLOAT(90.0, result); + // Add more test cases for different inputs and expected outputs +} #endif \ No newline at end of file From e46b1357b3af8d0e343da863be820fb5a6bc5716 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:28:01 +0100 Subject: [PATCH 53/93] logarithmPlusOne --- src/c/funktionen.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index b069db3..64a3479 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -132,3 +132,14 @@ float radiansToDegrees(float x) { return x * (180 / M_PI); } +// Function to calculate the base 10 logarithm of a number and add 1 +float logarithmPlusOne(float x) { + if (x > 0) { + return log10(x) + 1; + } + else { + printf("Error: Invalid input for logarithm + 1!\n"); + return 0; + } +} + From 0e369f4d0b687aa78bb62976e666d7b7515f4766 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:28:14 +0100 Subject: [PATCH 54/93] logarithmPlusOne header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 9726659..e26c1a5 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -58,4 +58,7 @@ float degreesToRadians(float x); // Function to convert radians to degrees float radiansToDegrees(float x); + +// Function to calculate the base 10 logarithm of a number and add 1 +float logarithmPlusOne(float x); #endif \ No newline at end of file From 65c7cafc1c36f7d83ac907637ff141f8e9a07030 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:29:05 +0100 Subject: [PATCH 55/93] logarithmPlusOne test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index d6546dc..09bed6c 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -184,4 +184,10 @@ void test_radiansToDegrees(void) { TEST_ASSERT_EQUAL_FLOAT(90.0, result); // Add more test cases for different inputs and expected outputs } + +void test_logarithmPlusOne(void) { + float result = logarithmPlusOne(10.0); + TEST_ASSERT_EQUAL_FLOAT(2.0, result); + // Add more test cases for different inputs and expected outputs +} #endif \ No newline at end of file From 5d9f67387089979c63600b183b3e223eb53a6783 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:41:45 +0100 Subject: [PATCH 56/93] naturalLogarithmPlusOne --- src/c/funktionen.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 64a3479..3d33778 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -143,3 +143,14 @@ float logarithmPlusOne(float x) { } } +// Function to calculate the natural logarithm (base e) of a number and add 1 +float naturalLogarithmPlusOne(float x) { + if (x > 0) { + return log(x) + 1; + } + else { + printf("Error: Invalid input for natural logarithm + 1!\n"); + return 0; + } +} + From 92b99a0f574c7df1597255644a0635a3ab497f53 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:41:57 +0100 Subject: [PATCH 57/93] naturalLogarithmPlusOne header --- src/c/funktionen.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index e26c1a5..fde7c2c 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -61,4 +61,9 @@ float radiansToDegrees(float x); // Function to calculate the base 10 logarithm of a number and add 1 float logarithmPlusOne(float x); + +// Function to calculate the natural logarithm (base e) of a number and add 1 +float naturalLogarithmPlusOne(float x); + + #endif \ No newline at end of file From 05f5c81d72049abceef72506f006ff134f7e8dfa Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:42:25 +0100 Subject: [PATCH 58/93] naturalLogarithmPlusOne test --- src/test/test_funktionen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 09bed6c..4d17942 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -190,4 +190,11 @@ void test_logarithmPlusOne(void) { TEST_ASSERT_EQUAL_FLOAT(2.0, result); // Add more test cases for different inputs and expected outputs } + +void test_naturalLogarithmPlusOne(void) { + float result = naturalLogarithmPlusOne(10.0); + TEST_ASSERT_EQUAL_FLOAT(3.302585, result); +// Add more test cases for different inputs and expected outputs + +} #endif \ No newline at end of file From 5f4690b00472e50e1f1497f4e705d96f4a5aa57e Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:46:07 +0100 Subject: [PATCH 59/93] squareRootPlusOne --- src/c/funktionen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 3d33778..d3e8510 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -154,3 +154,13 @@ float naturalLogarithmPlusOne(float x) { } } +// Function to calculate the square root of a number and add 1 +float squareRootPlusOne(float x) { + if (x >= 0) { + return sqrt(x) + 1; + } + else { + printf("Error: Invalid input for square root + 1!\n"); + return 0; + } +} From af93054f927f4ac510be874038d9ed146e5ad619 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:46:19 +0100 Subject: [PATCH 60/93] squareRootPlusOne header --- src/c/funktionen.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index fde7c2c..82dc677 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -65,5 +65,7 @@ float logarithmPlusOne(float x); // Function to calculate the natural logarithm (base e) of a number and add 1 float naturalLogarithmPlusOne(float x); +// Function to calculate the square root of a number and add 1 +float squareRootPlusOne(float x); #endif \ No newline at end of file From 42fdd85b3c58c7d1165611e7ff2e0625e3d57bb6 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:47:12 +0100 Subject: [PATCH 61/93] squareRootPlusOne test --- src/test/test_funktionen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 4d17942..f9ec6c7 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -197,4 +197,11 @@ void test_naturalLogarithmPlusOne(void) { // Add more test cases for different inputs and expected outputs } + +void test_squareRootPlusOne(void) { + float result = squareRootPlusOne(9.0); + TEST_ASSERT_EQUAL_FLOAT(4.0, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 029d81db445de79a97968b23981bf376df2cf7d4 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:47:39 +0100 Subject: [PATCH 62/93] floorValue --- src/c/funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index bffcaeb..8b9dcbf 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -71,3 +71,9 @@ printf("Error: Invalid input for factorial!\n"); return 0; } } + +// Function to calculate the floor value of a number +float floorValue(float x) { +return floor(x); +} + From 77e1f6df266b3461c25f756d811297c631a796f7 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:48:12 +0100 Subject: [PATCH 63/93] floorValue Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 7a45053..40ce9c4 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -28,4 +28,7 @@ float power(float x, float y); // Function to calculate the factorial of a number int factorial(int x); +// Function to calculate the floor value of a number +float floorValue(float x); + #endif \ No newline at end of file From c8e46255b0748ee9a6d608826513ddf68e61e40e Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:48:39 +0100 Subject: [PATCH 64/93] floorvalue Funktion test --- 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 b0f2bd4..7d7c1b8 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -29,7 +29,6 @@ void test_cube(void) { void test_cubeRoot(void) { float result = cubeRoot(27.0); TEST_ASSERT_EQUAL_FLOAT(3.0, result); - // Add more test cases for different inputs and expected outputs } void test_absolute(void) { @@ -40,26 +39,27 @@ void test_absolute(void) { void test_logarithm(void) { float result = logarithm(100.0); TEST_ASSERT_FLOAT_WITHIN(0.000001, 2.0, result); - // Add more test cases for different inputs and expected outputs } void test_naturalLogarithm(void) { float result = naturalLogarithm(100.0); TEST_ASSERT_FLOAT_WITHIN(0.000001, 4.60517, result); - // Add more test cases for different inputs and expected outputs } void test_power(void) { float result = power(2.0, 3.0); TEST_ASSERT_FLOAT_WITHIN(0.000001, 8.0, result); - // Add more test cases for different inputs and expected outputs } void test_factorial(void) { int result = factorial(5); TEST_ASSERT_EQUAL_INT(120, result); - // Add more test cases for different inputs and expected outputs } +void test_floorValue(void) { + float result = floorValue(5.7); + TEST_ASSERT_EQUAL_FLOAT(5.0, result); +} + #endif \ No newline at end of file From 6305daa3bc19d4355242325475e0d2e9c1b52841 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:54:25 +0100 Subject: [PATCH 65/93] ceilingValue Funktion --- src/c/funktionen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 8b9dcbf..1796b2c 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -77,3 +77,7 @@ float floorValue(float x) { return floor(x); } +// Function to calculate the ceiling value of a number +float ceilingValue(float x) { +return ceil(x); +} From 927b7b589dfaf2ed16802f20420ab1c0f047f84f Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:54:40 +0100 Subject: [PATCH 66/93] ceilingValue Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 40ce9c4..d2387c9 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -31,4 +31,7 @@ int factorial(int x); // Function to calculate the floor value of a number float floorValue(float x); +// Function to calculate the ceiling value of a number +float ceilingValue(float x); + #endif \ No newline at end of file From ed35b3efc303b11e2ee21afee65d82e4660beac3 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:55:07 +0100 Subject: [PATCH 67/93] ceilingValue Funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 7d7c1b8..86c3260 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -62,4 +62,10 @@ void test_floorValue(void) { TEST_ASSERT_EQUAL_FLOAT(5.0, result); } +void test_ceilingValue(void) { + float result = ceilingValue(5.2); + TEST_ASSERT_EQUAL_FLOAT(6.0, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 823ac2a8c6fb9e3f5df6df7b96f81e19589d6508 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:58:28 +0100 Subject: [PATCH 68/93] test_absoluteDifference Funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 1796b2c..1674f5f 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -81,3 +81,8 @@ return floor(x); float ceilingValue(float x) { return ceil(x); } + +// Function to calculate the absolute difference between two numbers +float absoluteDifference(float x, float y) { + return fabs(x - y); +} From 69faf25cc66ef8f06fb2e3f97f1e27175a60f4c0 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:58:43 +0100 Subject: [PATCH 69/93] test_absoluteDifference Funktoin header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index d2387c9..0a83972 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -34,4 +34,7 @@ float floorValue(float x); // Function to calculate the ceiling value of a number float ceilingValue(float x); +// Function to calculate the absolute difference between two numbers +float absoluteDifference(float x, float y); + #endif \ No newline at end of file From 32ba90e18374b0ce0d4a2f022b03011b52085661 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 21:59:17 +0100 Subject: [PATCH 70/93] test_absoluteDifference Funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 86c3260..1ccee94 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -68,4 +68,10 @@ void test_ceilingValue(void) { // Add more test cases for different inputs and expected outputs } +void test_absoluteDifference(void) { + float result = absoluteDifference(8.0, 4.5); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 3.5, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From ac9b0da38942a3f1200ff333f934cf678befbffe Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:59:45 +0100 Subject: [PATCH 71/93] cubeRootPlusOne --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index d3e8510..1b6961d 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -164,3 +164,8 @@ float squareRootPlusOne(float x) { return 0; } } + +// Function to calculate the cube root of a number and add 1 +float cubeRootPlusOne(float x) { + return cbrt(x) + 1; +} From 548af9221c41f5b2246911a504d6d2d04297292b Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 21:59:55 +0100 Subject: [PATCH 72/93] cubeRootPlusOne header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 82dc677..43f26bd 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -68,4 +68,7 @@ float naturalLogarithmPlusOne(float x); // Function to calculate the square root of a number and add 1 float squareRootPlusOne(float x); +// Function to calculate the cube root of a number and add 1 +float cubeRootPlusOne(float x); + #endif \ No newline at end of file From e31f99b42d909e52a1a723ddff0809c6e385c52a Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:00:17 +0100 Subject: [PATCH 73/93] cubeRootPlusOne test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index f9ec6c7..4c3ce24 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -204,4 +204,10 @@ void test_squareRootPlusOne(void) { // Add more test cases for different inputs and expected outputs } +void test_cubeRootPlusOne(void) { + float result = cubeRootPlusOne(8.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 3.0, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 93673e0e4f64c03dd9a9ec37f6b6f31f1718f83d Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:01:34 +0100 Subject: [PATCH 74/93] maximum Funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 1674f5f..c16fd87 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -86,3 +86,8 @@ return ceil(x); float absoluteDifference(float x, float y) { return fabs(x - y); } + +// Function to calculate the maximum of two numbers +float maximum(float x, float y) { + return fmax(x, y); +} From cf91788bf03145ad05f9ea46ef3d913ad3302e5c Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:01:55 +0100 Subject: [PATCH 75/93] maximum Funkion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 0a83972..768db23 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -37,4 +37,7 @@ float ceilingValue(float x); // Function to calculate the absolute difference between two numbers float absoluteDifference(float x, float y); +// Function to calculate the maximum of two numbers +float maximum(float x, float y); + #endif \ No newline at end of file From da9383d3721ed19aa9c453d8123b6bdfc886d668 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:02:21 +0100 Subject: [PATCH 76/93] maximum Funktion test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 1ccee94..9fe8f3a 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -74,4 +74,10 @@ void test_absoluteDifference(void) { // Add more test cases for different inputs and expected outputs } +void test_maximum(void) { + float result = maximum(5.0, 9.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 9.0, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 0ab016ee9cb1feff355fce5e49b63af060efb298 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:05:17 +0100 Subject: [PATCH 77/93] minimum Funktion --- src/c/funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index c16fd87..6295843 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -91,3 +91,9 @@ float absoluteDifference(float x, float y) { float maximum(float x, float y) { return fmax(x, y); } + +// Function to calculate the minimum of two numbers +float minimum(float x, float y) { + return fmin(x, y); +} + From d260cbbba687adf32222b3b073c0a61181447166 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:05:42 +0100 Subject: [PATCH 78/93] minimum Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 768db23..dc466f6 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -40,4 +40,7 @@ float absoluteDifference(float x, float y); // Function to calculate the maximum of two numbers float maximum(float x, float y); +// Function to calculate the minimum of two numbers +float minimum(float x, float y); + #endif \ No newline at end of file From 996e26a9681131dde0aefb93cb12e8f3f57a2d0e Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:06:20 +0100 Subject: [PATCH 79/93] sineDegrees --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 1b6961d..0dc9a0d 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -169,3 +169,8 @@ float squareRootPlusOne(float x) { float cubeRootPlusOne(float x) { return cbrt(x) + 1; } + +// Function to calculate the sine of an angle in degrees +float sineDegrees(float x) { + return sin(degreesToRadians(x)); +} From 078271e0cb31455b6934f092eccdf191fb77a599 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:06:34 +0100 Subject: [PATCH 80/93] sineDegrees header --- src/c/funktionen.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 43f26bd..a46892d 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -71,4 +71,6 @@ float squareRootPlusOne(float x); // Function to calculate the cube root of a number and add 1 float cubeRootPlusOne(float x); +// Function to calculate the sine of an angle in degrees +float sineDegrees(float x); #endif \ No newline at end of file From 4135907e6d01254735465905134e1460715654e4 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:07:13 +0100 Subject: [PATCH 81/93] sineDegrees test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 4c3ce24..5cfa9b4 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -210,4 +210,10 @@ void test_cubeRootPlusOne(void) { // Add more test cases for different inputs and expected outputs } +void test_sineDegrees(void) { + float result = sineDegrees(45.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 0.7071068, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 10cc45800002a10cfa923906799cb301162ea58f Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:07:56 +0100 Subject: [PATCH 82/93] minimum Funktion test --- src/test/test_funktionen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 9fe8f3a..4f467f9 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -80,4 +80,11 @@ void test_maximum(void) { // Add more test cases for different inputs and expected outputs } +void test_minimum(void) { + float result = minimum(5.0, 9.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 5.0, result); + // Add more test cases for different inputs and expected outputs +} + + #endif \ No newline at end of file From 6e91e60300bee641fe73865844050375dd57c419 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:12:13 +0100 Subject: [PATCH 83/93] average Funktion --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 6295843..349fb54 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -97,3 +97,8 @@ float minimum(float x, float y) { return fmin(x, y); } +// Function to calculate the average of two numbers +float average(float x, float y) { + return (x + y) / 2; +} + From f8c56a241712f200f06da98a0a784aa0f3924f96 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:12:37 +0100 Subject: [PATCH 84/93] agerage Funktion header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index dc466f6..c4c1f27 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -43,4 +43,7 @@ float maximum(float x, float y); // Function to calculate the minimum of two numbers float minimum(float x, float y); +// Function to calculate the average of two numbers +float average(float x, float y); + #endif \ No newline at end of file From 040a693915003abf0f8627403c76002a13e3c79e Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:13:01 +0100 Subject: [PATCH 85/93] average Funktion test --- src/test/test_funktionen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 4f467f9..28788a2 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -65,26 +65,26 @@ void test_floorValue(void) { void test_ceilingValue(void) { float result = ceilingValue(5.2); TEST_ASSERT_EQUAL_FLOAT(6.0, result); - // Add more test cases for different inputs and expected outputs } void test_absoluteDifference(void) { float result = absoluteDifference(8.0, 4.5); TEST_ASSERT_FLOAT_WITHIN(0.000001, 3.5, result); - // Add more test cases for different inputs and expected outputs } void test_maximum(void) { float result = maximum(5.0, 9.0); TEST_ASSERT_FLOAT_WITHIN(0.000001, 9.0, result); - // Add more test cases for different inputs and expected outputs } void test_minimum(void) { float result = minimum(5.0, 9.0); TEST_ASSERT_FLOAT_WITHIN(0.000001, 5.0, result); - // Add more test cases for different inputs and expected outputs } +void test_average(void) { + float result = average(5.0, 9.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 7.0, result); +} #endif \ No newline at end of file From f71efd1144e38aa3aca13d8be94a25fbe2561231 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:13:05 +0100 Subject: [PATCH 86/93] test_cosineDegrees --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 0dc9a0d..8900f8b 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -174,3 +174,8 @@ float cubeRootPlusOne(float x) { float sineDegrees(float x) { return sin(degreesToRadians(x)); } + +// Function to calculate the cosine of an angle in degrees +float cosineDegrees(float x) { + return cos(degreesToRadians(x)); +} From e701e41fdc0e0b8c7b782ee4b14e008a21cec1be Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:13:16 +0100 Subject: [PATCH 87/93] test_cosineDegrees header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index a46892d..2c8a912 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -73,4 +73,7 @@ float cubeRootPlusOne(float x); // Function to calculate the sine of an angle in degrees float sineDegrees(float x); + +// Function to calculate the cosine of an angle in degrees +float cosineDegrees(float x); #endif \ No newline at end of file From 740657c846e3ace6357c72bc9f966ec74c96ea52 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:13:49 +0100 Subject: [PATCH 88/93] test_cosineDegrees test --- src/test/test_funktionen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 5cfa9b4..04aa2a7 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -216,4 +216,10 @@ void test_sineDegrees(void) { // Add more test cases for different inputs and expected outputs } +void test_cosineDegrees(void) { + float result = cosineDegrees(60.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 0.5, result); + // Add more test cases for different inputs and expected outputs +} + #endif \ No newline at end of file From 02ad6ca4dc7f51a152f4a441fb975990b7d12d20 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:19:52 +0100 Subject: [PATCH 89/93] remainderValue Funktion --- src/c/funktionen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 349fb54..b1ba42c 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -102,3 +102,7 @@ float average(float x, float y) { return (x + y) / 2; } +// Function to calculate the remainder of division between two numbers +float remainderValue(float x, float y) { + return fmod(x, y); +} From 45a892c70233c7dcafb089c67628c4c8ce42c258 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:21:27 +0100 Subject: [PATCH 90/93] test_tangentDegrees --- src/c/funktionen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 8900f8b..83ed4ba 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -179,3 +179,8 @@ float sineDegrees(float x) { float cosineDegrees(float x) { return cos(degreesToRadians(x)); } + +// Function to calculate the tangent of an angle in degrees +float tangentDegrees(float x) { + return tan(degreesToRadians(x)); +} From 89237a7d02bf7eaaf4f601417c58a395b843236d Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:21:36 +0100 Subject: [PATCH 91/93] test_tangentDegrees header --- src/c/funktionen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 2c8a912..21ce901 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -76,4 +76,7 @@ float sineDegrees(float x); // Function to calculate the cosine of an angle in degrees float cosineDegrees(float x); + +// Function to calculate the tangent of an angle in degrees +float tangentDegrees(float x); #endif \ No newline at end of file From d1cbecabb9f0320822dc91047b950dcc732e9c28 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 22:21:50 +0100 Subject: [PATCH 92/93] remainderValue Funktion test --- src/c/funktionen.h | 2 ++ src/test/test_funktionen.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/c/funktionen.h b/src/c/funktionen.h index c4c1f27..26f686a 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -46,4 +46,6 @@ float minimum(float x, float y); // Function to calculate the average of two numbers float average(float x, float y); +// Function to calculate the remainder of division between two numbers +float remainderValue(float x, float y); #endif \ No newline at end of file diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 28788a2..db518d1 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -87,4 +87,10 @@ void test_average(void) { TEST_ASSERT_FLOAT_WITHIN(0.000001, 7.0, result); } +void test_remainderValue(void) { + float result = remainderValue(10.5, 3.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 1.5, result); +} + + #endif \ No newline at end of file From 51f5789b87b5d5da4268aec94e987a67962d5ecd Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 22:22:26 +0100 Subject: [PATCH 93/93] test_tangentDegrees test --- src/test/test_funktionen.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 04aa2a7..7161783 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -222,4 +222,13 @@ void test_cosineDegrees(void) { // Add more test cases for different inputs and expected outputs } +void test_tangentDegrees(void) { + float result = tangentDegrees(30.0); + TEST_ASSERT_FLOAT_WITHIN(0.000001, 0.5773503, result); + // Add more test cases for different inputs and expected outputs +} + + + + #endif \ No newline at end of file