Logarithmic Function


  • It returns the natural logarithm for the number .
  • Natural log is taken with the base "e" .

  • Syntax:

    float logf(float num);
    
    double log(double num);
    
    long double logl(long double num);

    Example:

    #include <math.h>
    #include <stdio.h>
    
      int main()
      {
        double x = 1.0;
    	
        do {
          printf("No : %f  , Log : %f\n", x, log(x));
          x++;
        } while (x<11.0);
    
        return 0;
      }   
     
    Back