How to calculate base-10 logarithm in C++

1 Answer

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

    return 0;
}
  
  
  
/*
run:
  
0.69897

*/

 



answered Feb 8, 2020 by avibootz

Related questions

1 answer 310 views
1 answer 182 views
2 answers 354 views
3 answers 373 views
...