From 4e07ded997065a63883a9273cc4062011433136b Mon Sep 17 00:00:00 2001 From: fdai7782 Date: Fri, 2 Feb 2024 15:33:23 +0000 Subject: [PATCH] Added naturalLogarithmFunction (ln) for natural logarithmic calculations --- src/main/c/main_taschenrechner.c | 5 +++++ src/main/c/taschenrechner.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index 9158895..eb9dad3 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -44,6 +44,11 @@ double logarithmFunction(double x) { // Logarithm with base 10 return log10(x); } + +double naturalLogarithmFunction(double x) { + // Natural logarithm (ln) + return log(x); +} diff --git a/src/main/c/taschenrechner.h b/src/main/c/taschenrechner.h index d177979..071fba0 100644 --- a/src/main/c/taschenrechner.h +++ b/src/main/c/taschenrechner.h @@ -9,14 +9,19 @@ int multiply(int a, int b); int divide(int a, int b); +// Trigonometric functions double sineFunction(double angle); double cosineFunction(double angle); double tangentFunction(double angle); +//.. +// Logarithmic functions double logarithmFunction(double x); +double naturalLogarithmFunction(double x); + int mode(int userChoice); int displayMenu();