You are here : Cmath.hlog10

log10() - math.h

The C library function double log10(double x) returns the common logarithm (base-10 logarithm) of x.


Syntax

double log10(double x)


Example

#include <stdio.h>
#include <math.h>

int main ()
{
   double x, ret;
   x = 10000;
  
   /* finding value of log1010000 */
   ret = log10(x);
   printf("log10(%lf) = %lf\n", x, ret);
   
   return(0);
}


Output / Return Value

log10(10000.000000) = 4.000000


Limitations


Alternatives / See Also


Reference