XPath/XQuery atan function

Summary

Returns the arc tangent of the argument.

Signature

math:atan(
$arg as xs:double?
) as xs:double?

Properties

This function is deterministic, context-independent, and focus-independent.

Rules

If $arg is the empty sequence, the function returns the empty sequence.

Otherwise the result is the arc tangent of $arg, as defined in the specification of the atan function applied to 64-bit binary floating point values. The result is in the range -π/2 to +π/2 radians.

Examples

The expression math:atan(()) returns ().

The expression math:atan(0) returns 0.0e0.

The expression math:atan(-0.0e0) returns -0.0e0.

The expression math:atan(1.0e0) returns 0.7853981633974483e0.

The expression math:atan(-1.0e0) returns -0.7853981633974483e0.

The expression math:atan(xs:double('NaN')) returns xs:double('NaN').

The expression math:atan(xs:double('INF')) returns 1.5707963267948966e0.

The expression math:atan(xs:double('-INF')) returns -1.5707963267948966e0.

Notes

The treatment of the underflow exception is defined in .

If $arg is positive or negative zero, the result is $arg.

If $arg is NaN then the result is NaN.

In other cases the result is an xs:double value representing an angle θ in radians in the range -π /2 <= θ <= + π /2.