Browse Source

logarithm funktion

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

10
src/c/funktionen.c

@ -32,3 +32,13 @@ return cbrt(x);
float absolute(float x) { float absolute(float x) {
return fabs(x); return fabs(x);
} }
// Function to calculate the logarithm (base 10) of a number
float logarithm(float x) {
if (x > 0) {
return log10(x);
} else {
printf("Error: Invalid input for logarithm!\n");
return 0;
}
}
Loading…
Cancel
Save