log10()

Declaration

double log10(double dX);

Description:

This function returns the log base 10 of the passed-in argument.

Overloads

float log10(float);
double log10(double);
long double log10(long double);

Related Functions

float log10f(float);
long double log10l(long double);

* Note: Since C does not allow function overloading, these other versions of this function exist.

Domain

(0, ∞)

Range

(-∞, ∞)

Periodicity

None

Symmetry

None

Asymptotes

x = 0





Example

#include <iostream>
#include <cmath>

int main() {
    using namespace std;

    double dX = 1000.0;
    cout << "x = " << dX << "  log10(x) = " << log10(dX) << endl;

    dX = 1.8;
    cout << "x = " << dX << "  log10(x) = " << log10(dX) << endl;

    return 0;
}

Output:

log10() Output