libm API Specification |
This chapter describes the basic Arithmetic and Mathematical functions.
This chapter contains information about functions performing basic arithmetic operations, such as splitting a float into its integer and fractional parts or retrieving the imaginary part of a complex value. These functions are declared in the header files math.h and complex.h.
Normalization Functions
Function |
Description |
frexp, frexpf, frexpl | Converts floating-point number to fractional and integral components |
ldexp, ldexpf, ldexpl | Multiplies a floating-point number by an integral power of 2. |
scalb, scalbf, scalbl | Loads exponent of a radix-independent floating-point number |
scalbln, scalblnf, scalblnl | Computes exponent using FLT_RADIX |
scalbn, scalbnf, scalbnl | Computes exponent using FLT_RADIX |
significand, significandf, significandl | Allows users to test conformance to -ieee754. |
Remainder Functions
Function |
Description |
drem, dremf, dreml | Floating-point remainder function |
fmod, fmodf, fmodl | Floating-point remainder function |
remainder, remainderf, remainderl | Floating-point remainder function |
Rounding Functions
Function |
Description |
floor, floorf, floorl | Largest integral value not greater than argument |
llrint, llrintf, llrintl | Round to nearest integer |
llround, llroundf, llroundl | Round to nearest integer, away from zero |
lrint, lrintf, lrintl | Round to nearest integer |
lround, lroundf, lroundl | Round to nearest integer, away from zero |
modf, modff, modfl | Extracts signed integral and fractional values from floating-point number |
nearbyint, nearbyintf, nearbyintl | Round to nearest integer |
rint, rintf, rintl | Round to nearest integer |
round, roundf, roundl | Round to nearest integer, away from zero |
ceil, ceilf, ceill | Smallest integral value not less than argument |
trunc, truncf, truncl | Round to integer, towards zero |
Setting and modifying single bits of FP values
Function |
Description |
copysign, copysignf, copysignl | Copy sign of a number |
nextafter, nextafterf, nextafterl | Floating point number manipulation |
nexttoward, nexttowardf, nexttowardl | Floating point number manipulation |
Examining the FPU status word
Function |
Description |
feclearexcept | C99 floating point rounding and exception handling |
fegetexceptflag | C99 floating point rounding and exception handling |
feraiseexcept | C99 floating point rounding and exception handling |
fesetexceptflag | C99 floating point rounding and exception handling |
fetestexcept | C99 floating point rounding and exception handling |
Floating-Point Control Functions
Function |
Description |
fegetenv | C99 floating point rounding and exception handling |
feholdexcept | C99 floating point rounding and exception handling |
fesetenv | C99 floating point rounding and exception handling |
feupdateenv | C99 floating point rounding and exception handling |
Floating-Point Number Classification Functions
Rounding Modes
Function |
Description |
fegetround | C99 floating point rounding and exception handling |
fesetround | C99 floating point rounding and exception handling |
Miscellaneous FP arithmetic functions
Absolute Value
Exponentiation and Logarithms
Function |
Description |
cbrt, cbrtf, cbrtl | Cube root function |
exp, expf, expl | Base-e exponential function |
exp2, exp2f | Base-2 exponential function |
expm1, expm1f, expm1l | Exponential minus 1 |
hypot, hypotf, hypotl | Euclidean distance function |
ilogb, ilogbf, ilogbl | Returns an unbiased exponent |
log, logf, logl | Natural logarithmic function |
log10, log10f, log10l | Base-10 logarithmic function |
log1p, log1pf, log1pl | Logarithm of 1 plus argument |
logb, logbf, logbl | Radix-independent exponent |
pow, powf, powl | Power functions |
sqrt, sqrtf, sqrtl | Square root function |
Hyperbolic Functions
Function |
Description |
acosh, acoshf, acoshl | Inverse hyperbolic cosine function |
asinh, asinhf, asinhl | Inverse hyperbolic sine function |
atanh, atanhf, atanhl | Inverse hyperbolic tangent function |
cosh, coshf, coshl | Hyperbolic cosine function |
sinh, sinhf, sinhl | Hyperbolic sine function |
tanh, tanhf, tanhl | Hyperbolic tangent function |
Inverse Trigonometric Functions
Function |
Description |
acos, acosf, acosl | Arc cosine function |
asin, asinf, asinl | Arc sine function |
atan, atanf, atanl | Arc tangent function |
atan2, atan2f, atan2l | Arc tangent function of two variables |
Special Functions
Function |
Description |
erf, erff, erfl | Error function and complementary error function |
erfc, erfcf, erfcl | Error function and complementary error function |
gamma, gammaf, gammal | logarithm of the gamma function |
j0, j0f, j0l | Bessel functions |
j1, j1f, j1l | Bessel functions |
jn, jnf, jnl | Bessel functions |
ldexp, ldexpf, ldexpl | Multiplies floating-point number by integral power of 2 |
lgamma, lgammaf, lgammal | Log gamma function |
lgamma_r, lgammaf_r, lgammal_r | Log gamma function |
tgamma | True gamma function |
y0, y0f, y0l | Bessel functions |
y1, y1f, y1l | Bessel functions |
yn, ynf, ynl | Bessel functions |
Trigonometric Functions
©Nokia 2007 |