HP Fortran Programmer's Reference (September 2007)

Intrinsic procedures
Intrinsic procedure specifications
Chapter 11528
Result value
The result has a value equal to a processor-dependent approximation to arctan(X), expressed
in radians, that lies in the range -Pi/2 <= ATAN(X) <= Pi/2.
Specific forms
DATAN, QATAN.
ATAN2(Y, X)
Description
Arctangent (inverse tangent) function in radians. The result is the principal value of the
argument of the nonzero complex number (X, Y).
Class
Elemental function.
Arguments
Y must be of type real.
X must be of the same type and kind type parameter as Y. If Y has the value
zero, X must not have the value zero.
Result type/
type parameters
Same as X.
Result value
The result has a value equal to a processor-dependent approximation to the principal value of
the argument of the complex number (X, Y), expressed in radians.
The result lies in the range -Pi <= ATAN2(Y, X) <= Pi and is equal to a processor-dependent
approximation to a value of arctan(Y/X) if X is not 0.
If Y>0, the result is positive. If Y=0, the result is zero if X>0 and the result is Pi if X<0. If Y<0,
the result is negative. If X=0, the absolute value of the result is Pi/2.
Specific forms
DATAN2,QATAN2.