From fd526fbb48f40f55cbd4f17c368bf6943773191c Mon Sep 17 00:00:00 2001 From: Ulriche Nguefack Date: Mon, 5 Feb 2024 22:01:08 +0100 Subject: [PATCH] power sine cosine tangent called --- src/main/c/Calculator/calculator.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index 6e75e9b..99894eb 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -227,4 +227,26 @@ double cube(double num) { double cubeRoot(double 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); }