
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
log() function in C++
The C/C++ library function double log(double x) returns the natural logarithm (basee logarithm) of x. Following is the declaration for log() function.
double log(double x)
The parameter is a floating point value. And this function returns natural logarithm of x.
Example
#include <iostream> #include <cmath> using namespace std; int main () { double x, ret; x = 2.7; /* finding log(2.7) */ ret = log(x); cout << "log("<< x <<") = " << ret; return(0); }
Output
log(2.7) = 0.993252
- Related Questions & Answers
- PHP log() Function
- log() function in PHP
- log() function for complex number in C++
- Log functions in C#
- Write an iterative O(Log y) function for pow(x, y) in C++
- Program to compute Log n in C
- Find minimum number of Log value needed to calculate Log upto N in C++
- Log functions in Python
- Log functions in Java
- Log functions in Python Program
- How to remove scientific notation from a Matplotlib log-log plot?
- Design Log Storage System in Python
- Reorder Data in Log Files in Python
- Prime Factorization using Sieve O(log n) for multiple queries in C++
- Turn on the general log in MySQL?
Advertisements