diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 64a3479..3d33778 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -143,3 +143,14 @@ float logarithmPlusOne(float x) { } } +// Function to calculate the natural logarithm (base e) of a number and add 1 +float naturalLogarithmPlusOne(float x) { + if (x > 0) { + return log(x) + 1; + } + else { + printf("Error: Invalid input for natural logarithm + 1!\n"); + return 0; + } +} +