How to calculate natural logarithm (base-e logarithm) in C++

1 Answer

0 votes
#include <bits/stdc++.h> 
  
using namespace std; 
  
int main()
{
    double d = 5;
    
    cout << log(d) << endl; 

    return 0;
}
  
  
  
/*
run:
  
1.60944

*/

 



answered Feb 8, 2020 by avibootz
...