From 389b6b0b09f911e81e6c01f982293c2967336d9f Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 4 Feb 2024 20:52:22 +0100 Subject: [PATCH] log_base_e Funktion --- src/c/funktionen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 6ec9a84..6cc0436 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -42,3 +42,13 @@ printf("Error: Invalid input for logarithm!\n"); return 0; } } + +// Function to calculate the natural logarithm (base e) of a number +float naturalLogarithm(float x) { +if (x > 0) { +return log(x); +} else { +printf("Error: Invalid input for natural logarithm!\n"); +return 0; +} +}