Browse Source

logarithmPlusOne

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

11
src/c/funktionen.c

@ -132,3 +132,14 @@ float radiansToDegrees(float x) {
return x * (180 / M_PI); return x * (180 / M_PI);
} }
// Function to calculate the base 10 logarithm of a number and add 1
float logarithmPlusOne(float x) {
if (x > 0) {
return log10(x) + 1;
}
else {
printf("Error: Invalid input for logarithm + 1!\n");
return 0;
}
}
Loading…
Cancel
Save