- C Library - <time.h>
- C Library - <string.h>
- C Library - <stdlib.h>
- C Library - <stdio.h>
- C Library - <stddef.h>
- C Library - <stdarg.h>
- C Library - <signal.h>
- C Library - <setjmp.h>
- C Library - <math.h>
- C Library - <locale.h>
- C Library - <limits.h>
- C Library - <float.h>
- C Library - <errno.h>
- C Library - <ctype.h>
- C Library - <assert.h>
- C Library - Home
C Standard Library Resources
C Programming Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
C Library - <math.h>
The math.h header defines various mathematical functions and one macro. All the functions available in this pbrary take double as an argument and return double as the result.
Library Macros
There is only one macro defined in this pbrary −
Sr.No. | Macro & Description |
---|---|
1 |
HUGE_VAL This macro is used when the result of a function may not be representable as a floating point number. If magnitude of the correct result is too large to be represented, the function sets errno to ERANGE to indicate a range error, and returns a particular, very large value named by the macro HUGE_VAL or its negation (- HUGE_VAL). If the magnitude of the result is too small, a value of zero is returned instead. In this case, errno might or might not be set to ERANGE. |
Library Functions
Following are the functions defined in the header math.h −
Sr.No. | Function & Description |
---|---|
1 |
Returns the arc cosine of x in radians. |
2 |
Returns the arc sine of x in radians. |
3 |
Returns the arc tangent of x in radians. |
4 |
Returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant. |
5 |
Returns the cosine of a radian angle x. |
6 |
Returns the hyperbopc cosine of x. |
7 |
Returns the sine of a radian angle x. |
8 |
Returns the hyperbopc sine of x. |
9 |
Returns the hyperbopc tangent of x. |
10 |
Returns the value of e raised to the xth power. |
11 |
The returned value is the mantissa and the integer pointed to by exponent is the exponent. The resultant value is x = mantissa * 2 ^ exponent. |
12 |
Returns x multipped by 2 raised to the power of exponent. |
13 |
Returns the natural logarithm (base-e logarithm) of x. |
14 |
Returns the common logarithm (base-10 logarithm) of x. |
15 |
The returned value is the fraction component (part after the decimal), and sets integer to the integer component. |
16 |
Returns x raised to the power of y. |
17 |
Returns the square root of x. |
18 |
Returns the smallest integer value greater than or equal to x. |
19 |
Returns the absolute value of x. |
20 |
Returns the largest integer value less than or equal to x. |
21 |
Returns the remainder of x spanided by y. |