From 440d7f5c25c789879bdf5517b1709a38a38dafca Mon Sep 17 00:00:00 2001 From: fdai7782 Date: Fri, 2 Feb 2024 15:43:33 +0000 Subject: [PATCH] Added exponentialFunction for exponential calculations --- src/main/c/main_taschenrechner.c | 7 +++++++ src/main/c/taschenrechner.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index 6820e7f..fe59f96 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -55,6 +55,13 @@ double logarithmBase2Function(double x) { // Logarithm with base 2 return log2(x); } +//.. +// Exponential function +double exponentialFunction(double x) { + // Exponential function (e^x) + return exp(x); +} + // scientificmode int scientificMode(){ diff --git a/src/main/c/taschenrechner.h b/src/main/c/taschenrechner.h index 1032900..17f2ce2 100644 --- a/src/main/c/taschenrechner.h +++ b/src/main/c/taschenrechner.h @@ -24,6 +24,10 @@ double naturalLogarithmFunction(double x); double logarithmBase2Function(double x); +//.. +// Exponential function +double exponentialFunction(double x); + int mode(int userChoice); int displayMenu();