log() function

The log() function returns the natural logarithm (base-e logarithm) of the argument.

The log() function takes a single mandatory argument in the range [0, ∞].

Note: If the value is less than zero, log() returns NaN (Not a Number).

Example:

Input:  x = 12.45
Output: 2.52172

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    double x = 12.45;

    cout << log(x);

    return 0;
}


No comments:

Post a Comment