Browse Source

naturalLogarithmPlusOne

remotes/origin/Khaled
Khaled 11 months ago
parent
commit
5d9f673870
  1. 11
      src/c/funktionen.c

11
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;
}
}
Loading…
Cancel
Save