Skip to content
class method

Math.tan

(::Math::double x) -> ::Float
Math.tan(x) → float

Returns the tangent of x in radians.

  • Domain: (-INFINITY, INFINITY).

  • Range: (-INFINITY, INFINITY).

Examples:

Example
tan(-PI)   # => 1.2246467991473532e-16  # -0.0000000000000001
tan(-PI/2) # => -1.633123935319537e+16  # -16331239353195370.0
tan(0.0)   # => 0.0
tan(PI/2)  # => 1.633123935319537e+16   # 16331239353195370.0
tan(PI)    # => -1.2246467991473532e-16 # -0.0000000000000001
See also .sqrt .tanh .sinh also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0