Math Library: math.h

Table F.6 lists the functions of the math library. The header file defines a macro HUGE_VAL that is used as the return value for functions when the magnitude of the result exceeds the largest representable value.

Table F.6. ANSI C standard math functions.
PrototypeDescription
double acos(double x);Returns the angle (0 to π radians) whose cosine is x.
double asin(double x);Returns the angle (−π/2 to π/2 radians) whose sine is x.
double atan(double x);Returns the angle (−π/2 to π/2 radians) whose tangent is x.
double atan2(double y, double x);Returns the angle (−π to π radians) whose tangent is y / x.
double cos(double x);Returns the cosine of x (x in radians).
double sin(double x);Returns the sine of x (x in radians).
double tan(double ...

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.