cc [flag ...] file ... -lm [library ...]#include <math.h>
double sin(double x);
float sinf(float x);
double cos(double x);
float cosf(float x);
double tan(double x);
float tanf(float x);
double asin(double x);
float asinf(float x);
double acos(double x);
float acosf(float x);
double atan(double x);
float atanf(float x);
double atan2(double y, double x);
float atan2f(float y, float x);
asin and asinf
return the arcsine of x,
in the range [-/2,+
/2].
acos and acosf return the arccosine of
x, in the range [0,+].
atan and atanf
return the arctangent of
x, in the range (-/2,+
/2).
atan2 and atan2f return the arctangent of
y/
in the range (-,+
],
using the signs of both arguments
to determine the quadrant of the return value.
On systems that support signed zeroes,
if the second argument to atan2 and atan2f is +0
and the first argument is ±0, these functions return ±0,
depending on the sign of the first argument.
When the second argument to atan2 or atan2f is -0 and
the first argument is ±0, these functions return ±,
depending on the sign of the first argument.
On systems that do not support signed zeroes, if both arguments to atan2
and atan2f are zero, the return value is zero.
In each of these cases, errno is set to EDOM.
On systems that support IEEE infinity, if the argument to
sin, sinf, cos, cosf, tan or
tanf is ±, they
return IEEE NaN, raise the invalid
operation exception and set errno to EDOM.
On systems that support IEEE NaN, if any of the arguments to any of these functions is a quiet NaN, that value is returned. If any of the arguments is a signaling NaN, a quiet NaN is returned and the invalid operation exception is raised. In either case, errno is set to EDOM.
If the program was compiled with the -Xt compilation mode, if the magnitude of the argument to asin, asinf, acos, or acosf is greater than 1 or when both arguments to atan2 or atan2f are zero, they return zero and set errno to EDOM. In addition, a message indicating DOMAIN error is printed on the standard error output. These error handling procedures may be changed with the function matherr.