Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (a - e) atan2(3)
NAME
atan2 - Computes the inverse trigonometric tangent function of y/x
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
SYNOPSIS
#include <math.h>
double atan2(
double y,
double x);
PARAMETERS
y Is the denominator of the value for which the inverse trigonometric tangent func-
tion is to be computed.
x Is the numerator of the value for which the inverse trigonometric tangent func-
tion is to be computed.
DESCRIPTION
The atan2() function computes the principal value of the arc tangent of y/x, in the domain [-π, π]
radians, using the signs of both parameters to determine the quadrant of the return value.
NOTES
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values
in the native environment. IEEE values can include NaN and infinity, and the sign of 0.0 (zero)
can be either positive or negative. Refer to the fp_class(3) reference page for a description of
IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmer’s Guide for a discussion of floating-point conversions.
RETURN VALUES
The atan2() function returns the principal value of the arc tangent of y/x.
For IEEE floating-point values, if the value of x or y is NaN, the atan2() function returns NaN. If
both the value of x and y is positive or negative 0.0 (zero), the atan2() function returns 0.0 (zero)
and sets errno to [EDOM].
For Tandem floating-point values, if both the value of x and y is 0.0 (zero), the atan2() function
returns HUGE_VAL and sets errno to [EDOM].
ERRORS
If any of the following conditions occurs, the atan2() function sets errno to the corresponding
value:
[EDOM] Both arguments are 0.0 (zero).
RELATED INFORMATION
Functions: acos(3), acosh(3), asin(3), asinh(3), atan(3), atanh(3), cos(3), cosh(3), fp_class(3),
isnan(3), sin(3), sinh(3), tan(3), tanh(3).
Files: float(4), math(4).
527192-005 Hewlett-Packard Company 1−15