Browse Source

Added squareRootFunction for calculating square roots

remotes/origin/feature
fdai7782 11 months ago
parent
commit
1a2e13f0c7
  1. 7
      src/main/c/main_taschenrechner.c
  2. 4
      src/main/c/taschenrechner.h

7
src/main/c/main_taschenrechner.c

@ -22,6 +22,13 @@ int divide(int a, int b) {
return a / b; return a / b;
} }
// Square root function
double squareRootFunction(double x) {
// Using the sqrt function from math.h
return sqrt(x);
}
//..
// Trigonometric functions // Trigonometric functions
double sineFunction(double angle) { double sineFunction(double angle) {
// Convert degrees to radians for trigonometric functions // Convert degrees to radians for trigonometric functions

4
src/main/c/taschenrechner.h

@ -9,6 +9,10 @@ int multiply(int a, int b);
int divide(int a, int b); int divide(int a, int b);
// Square root function
double squareRootFunction(double x);
//..
// Trigonometric functions // Trigonometric functions
double sineFunction(double angle); double sineFunction(double angle);

Loading…
Cancel
Save