The OpenD Programming Language

tan

Returns tangent of x. x is in radians.

Special Values
xtan(x)invalid?
NaNNaNyes
±0.0±0.0no
$(PLUSMNINF)NaNyes
  1. real tan(real x)
    pragma(inline, true) @safe pure nothrow @nogc
    real
    tan
    (
    real x
    )
  2. double tan(double x)
  3. float tan(float x)

Examples

import std.math.operations : isClose;
import std.math.traits : isIdentical;
import std.math.constants : PI;
import std.math.algebraic : sqrt;

assert(isIdentical(tan(0.0), 0.0));
assert(tan(PI).isClose(0, 0.0, 1e-10));
assert(tan(PI / 3).isClose(sqrt(3.0)));

Meta