This chapter groups a wide variety of mathematical functions. The corresponding definitions and declarations are in math.h. The definition of HUGE_VAL from math.h is of particular interest.
double
is defined as
HUGE_VAL
; this number is returned on overflow by many functions.
The macro HUGE_VALF
is a corresponding value for float
.
Alternative declarations of the mathematical functions, which exploit specific machine capabilities to operate faster—but generally have less error checking and may reflect additional limitations on some machines—are available when you include fastmath.h instead of math.h.
• version: | Version of library | |
• acos: | Arccosine | |
• acosh: | Inverse hyperbolic cosine | |
• asin: | Arcsine | |
• asinh: | Inverse hyperbolic sine | |
• atan: | Arctangent | |
• atan2: | Arctangent of y/x | |
• atanh: | Inverse hyperbolic tangent | |
• jN: | Bessel functions (jN, yN) | |
• cbrt: | Cube root | |
• copysign: | Sign of Y, magnitude of X | |
• cosh: | Hyperbolic cosine | |
• erf: | Error function (erf, erfc) | |
• exp: | Exponential, base e | |
• exp10: | Exponential, base 10 | |
• exp2: | Exponential, base 2 | |
• expm1: | Exponential, base e, of x - 1 | |
• fabs: | Absolute value (magnitude) | |
• fdim: | Positive difference | |
• floor: | Floor and ceiling (floor, ceil) | |
• fma: | Floating multiply add | |
• fmax: | Maximum | |
• fmin: | Minimum | |
• fmod: | Floating-point remainder (modulo) | |
• fpclassify: | Floating-point classification macro | |
• frexp: | Split floating-point number | |
• gamma: | Logarithmic gamma function | |
• hypot: | Distance from origin | |
• ilogb: | Get exponent | |
• infinity: | Floating infinity | |
• isgreater: | Comparison macros | |
• ldexp: | Scale by a power of 2 | |
• log: | Natural logarithms | |
• log10: | Base 10 logarithms | |
• log1p: | Log of 1 + X | |
• log2: | Base 2 logarithms | |
• logb: | Get exponent | |
• lrint: | Round to integer | |
• lround: | Round to integer, away from zero (lround, llround) | |
• modf: | Split fractional and integer parts | |
• nan: | Floating Not a Number | |
• nearbyint: | Round to integer | |
• nextafter: | Get next representable number | |
• pow: | X to the power Y | |
• pow10: | 10 to the power X | |
• remainder: | remainder of X divided by Y | |
• remquo: | Remainder and part of quotient | |
• rint: | Round to integer | |
• round: | Round to integer, away from zero | |
• scalbn: | Scale by a power of FLT_RADIX (2) | |
• signbit: | Does floating-point number have negative sign? | |
• sin: | Sine or cosine (sin, cos) | |
• sinh: | Hyperbolic sine | |
• sqrt: | Positive square root | |
• tan: | Tangent | |
• tanh: | Hyperbolic tangent | |
• trunc: | Round to integer, towards zero |