log1p - C math.h

C examples for math.h:log1p

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Returns the natural logarithm of one plus x.

Prototype

long double log1pl (long double x);
long double log1p (long double x);
     double log1p  (double x);
      float log1pf (float x);
      float log1p (float x);
     double log1p (T x);           

Parameters

Parameter Description
x Value whose logarithm is calculated. If the argument is less than -1, a domain error occurs.

Return Value

The natural logarithm of (1+x).

Demo Code


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

int main ()//from ww  w  . jav a 2 s  .  co  m
{
  
  double param = 1.0;
  
  double result = log1p (param);
  
  printf ("log1p (%f) = %f.\n", param, result );
  
  return 0;
}

Related Tutorials