Browse Source

power sine cosine tangent called

remotes/origin/Ulrich
Ulriche Nguefack 11 months ago
parent
commit
fd526fbb48
  1. 22
      src/main/c/Calculator/calculator.c

22
src/main/c/Calculator/calculator.c

@ -227,4 +227,26 @@ double cube(double num) {
double cubeRoot(double num) { double cubeRoot(double num) {
return cbrt(num); return cbrt(num);
}double factorial(double num) {
if (num == 0) {
return 1;
} else {
return num * factorial(num - 1);
}
}
double power(double base, double exponent) {
return pow(base, exponent);
}
double sine(double angle) {
return sin(angle * M_PI / 180.0);
}
double cosine(double angle) {
return cos(angle * M_PI / 180.0);
}
double tangent(double angle) {
return tan(angle * M_PI / 180.0);
} }
Loading…
Cancel
Save