diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index d9bda36..af494d1 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -22,6 +22,13 @@ int divide(int a, int b) { return a / b; } +// Square root function +double squareRootFunction(double x) { + // Using the sqrt function from math.h + return sqrt(x); +} + +//.. // Trigonometric functions double sineFunction(double angle) { // Convert degrees to radians for trigonometric functions diff --git a/src/main/c/taschenrechner.h b/src/main/c/taschenrechner.h index 76acfb3..1053da9 100644 --- a/src/main/c/taschenrechner.h +++ b/src/main/c/taschenrechner.h @@ -9,6 +9,10 @@ int multiply(int a, int b); int divide(int a, int b); +// Square root function +double squareRootFunction(double x); + +//.. // Trigonometric functions double sineFunction(double angle);