2.7 math.h
The math header defines several mathematic functions.
Macros:
HUGE_VAL
Functions:
acos();
asin();
atan();
atan2();
ceil();
cos();
cosh();
exp();
fabs();
floor();
fmod();
frexp();
ldexp();
log();
log10();
modf();
pow();
sin();
sinh();
sqrt();
tan();
tanh();
2.7.1 Error Conditions
All math.h functions handle errors similarly.
In the case that the argument passed to the function exceeds the range of that function, then the variable
errno
is set toEDOM
. The value that the function returns is implementation specific.In the case that the value being returned is too large to be represented in a double, then the function returns the macro
HUGE_VAL
, and sets the variableerrno
toERANGE
to represent an overflow. If the value is too small to be represented in a double, then the function returns zero. In this case whether or noterrno
is set toERANGE
is implementation specific.
errno
,EDOM
, andERANGE
are defined in the errno.h header.Note that in all cases when it is stated that there is no range limit, it is implied that the value is limited by the minimum and maximum values of type double.