# math:tan - XPath XQuery Reference

Returns the tangent of the argument. The argument is an angle in radians.deterministiccontext-independentfocus-independentIf $θ is the empty sequence, the function returns the empty
            sequence.Otherwise the result is the tangent of $θ (which is treated as an angle
            in radians) as defined in the  specification of the
               tan function applied to 64-bit binary floating point values.math:tan(())()math:tan(0)0.0e0math:tan(-0.0e0)-0.0e0math:tan(math:pi() div 4)1.0e0math:tan(-math:pi() div 4)-1.0e01 div math:tan(math:pi() div 2)0.0e0Mathematically, tan(π/2) is positive infinity. But because math:pi() div 2
                  returns an approximation, the result of math:tan(math:pi() div 2) will be a large
                  but finite number.1 div math:tan(-math:pi() div 2)-0.0e0Mathematically, tan(-π/2) is negative infinity. But because -math:pi() div 2
                  returns an approximation, the result of math:tan(-math:pi() div 2) will be a large
                  but finite negative number.math:tan(math:pi())0.0e0math:tan(xs:double('NaN'))xs:double('NaN')math:tan(xs:double('INF'))xs:double('NaN')math:tan(xs:double('-INF'))xs:double('NaN')The treatment of the invalidOperation and underflow exceptions
            is defined in . If $θ is positive or negative infinity, or NaN,
            then the result is NaN.