Syntax
#include <math.h> double log10(double x);Description
log10 calculates the base 10 logarithm of x.
log10 returns the computed value. If x is negative, log10 sets errno to EDOM and may return the value -HUGE_VAL. If x is zero, log10 returns the value -HUGE_VAL, and may set errno to ERANGE.
This example calculates the base 10 logarithm of 1000.0.
#include <math.h> int main(void) { double x = 1000.0,y; y = log10(x); printf("The base 10 logarithm of %lf is %lf\n", x, y); return 0; /**************************************************************************** The output should be: The base 10 logarithm of 1000.000000 is 3.000000 ****************************************************************************/ }Related Information