diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index eb9dad3..6820e7f 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -39,6 +39,7 @@ double tangentFunction(double angle) { return tan(angle * M_PI / 180.0); } +//.. // Logarithmic functions double logarithmFunction(double x) { // Logarithm with base 10 @@ -49,8 +50,11 @@ double naturalLogarithmFunction(double x) { // Natural logarithm (ln) return log(x); } - +double logarithmBase2Function(double x) { + // Logarithm with base 2 + return log2(x); +} // scientificmode int scientificMode(){ diff --git a/src/main/c/taschenrechner.h b/src/main/c/taschenrechner.h index 071fba0..1032900 100644 --- a/src/main/c/taschenrechner.h +++ b/src/main/c/taschenrechner.h @@ -22,6 +22,8 @@ double logarithmFunction(double x); double naturalLogarithmFunction(double x); +double logarithmBase2Function(double x); + int mode(int userChoice); int displayMenu();