@ -32,3 +32,13 @@ return cbrt(x);
float absolute(float 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;