Browse Source

log_base_e Funktion

remotes/origin/Abdelrahman
Abdelrahman 11 months ago
parent
commit
389b6b0b09
  1. 10
      src/c/funktionen.c

10
src/c/funktionen.c

@ -42,3 +42,13 @@ printf("Error: Invalid input for logarithm!\n");
return 0; 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;
}
}
Loading…
Cancel
Save