Browse Source

Added sineFunction for trigonometric calculations

remotes/origin/feature
fdai7782 11 months ago
parent
commit
8d69bf6c8f
  1. 6
      src/main/c/main_taschenrechner.c
  2. 2
      src/main/c/taschenrechner.h

6
src/main/c/main_taschenrechner.c

@ -22,6 +22,12 @@ int divide(int a, int b) {
return a / b;
}
// Trigonometric functions
double sineFunction(double angle) {
// Convert degrees to radians for trigonometric functions
return sin(angle * M_PI / 180.0);
}
// scientificmode

2
src/main/c/taschenrechner.h

@ -9,6 +9,8 @@ int multiply(int a, int b);
int divide(int a, int b);
double sineFunction(double angle);
int mode(int userChoice);
int displayMenu();

Loading…
Cancel
Save