tan()

Declaration

double tan(double dX);

Description:

This function returns the tangent of the passed-in argument.

Overloads

float tan(float);
double tan(double);
long double tan(long double);

Related Functions

float tanf(float);
long double tanl(long double);

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

Domain

(-∞, ∞) \
{Π/2.0 +- k*Π}

Range

(-∞, ∞)

Periodicity

Π

Symmetry

Origin

Asymptotes

None





Example

#include <iostream>
#include <cmath>

int main() {
    using namespace std;

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

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

    return 0;
}

Output:

tan() Output