Monday, October 31, 2016

C Library Function – math

The <math.h> header shall define the following function(s).

Trigonometric Functions:
arg - floating point value representing an angle in radians

sin double sin( double arg );
sinf(C99) float sinf( float arg );
sinl(C99) long double sinl( long double arg );
cos double cos( double arg );
cosf(C99) float cosf( float arg );
cosl(C99) long double cosl( long double arg );
tan double tan( double arg );
tanf(C99) float tanf( float arg );
tanl(C99) long double tanl( long double arg );
asin double asin( double arg );
asinf(C99) float asinf( float arg );
asinl(C99) long double asinl( long double arg );
acos double acos( double arg );
acosf(C99) float acosf( float arg );
acosl(C99) long double acosl( long double arg );
atan double atan( double arg );
atanf(C99) float atanf( float arg );
atanl(C99) long double atanl( long double arg );
atan2 double atan2( double arg );
atan2f(C99) float atan2f( float arg );
atan2l(C99) long double atan2l( long double arg );

Hyperbolic Functions:
arg - floating point value representing a hyperbolic angle

sinh double sinh( double arg );
sinhf(C99) float sinhf( float arg );
sinhl(C99) long double sinhl( long double arg );
cosh double cosh( double arg );
coshf(C99) float coshf( float arg );
coshl(C99) long double coshl( long double arg );
tanh double tanh( double arg );
tanhf(C99) float tanhf( float arg );
tanhl(C99) long double tanhl( long double arg );
asinh(C99) double asinh( double arg );
asinhf(C99) float asinhf( float arg );
asinhl(C99) long double asinhl( long double arg );
acosh(C99) double acosh( double arg );
acoshf(C99) float acoshf( float arg );
acoshl(C99) long double acoshl( long double arg );
atanh(C99) double atanh( double arg );
atanhf(C99) float atanhf( float arg );
atanhl(C99) long double atanhl( long double arg );

Exponential and Logarithmic Functions:
arg - floating point value
*exp *iptr - to store the integral part
exp – integer value

exp double exp( double arg );
expf(C99) float expf( float arg );
expl(C99) long double expl( long double arg );
exp2(C99) double exp2( double arg );
exp2f(C99) float exp2f( float arg );
exp2l(C99) long double exp2l( long double arg );
expm1(C99) double expm1( double arg );
expm1f(C99) float expm1f( float arg );
expm1l(C99) long double expm1l( long double arg );
frexp double frexp( double arg , int* exp );
frexpf(C99) float frexpf( float arg , int* exp );
frexpl(C99) long double frexpl( long double arg , int* exp );
ilogb(C99) int ilogb( double arg );
ilogbf(C99) int ilogbf( float arg );
ilogbl(C99) int ilogbl( long double arg );
ldexp double ldexp( double arg , int exp );
ldexpf(C99) float ldexpf( float arg , int exp );
ldexpl(C99) long double ldexpl( long double arg , int exp );
log double log ( double arg );
logf(C99) float logf ( float arg );
logl(C99) long double logl( long double arg );
log10 double log10l ( double arg );
log10f(C99) float log10lf ( float arg );
log10l(C99) long double log10l( long double arg );
log1p(C99) double log1pl ( double arg );
log1pf(C99) float log1plf( float arg );
log1pl(C99) long double log1pl( long double arg );
log2(C99) double log2l ( double arg );
log2f(C99) float log2lf ( float arg );
log2l(C99) long double log2l( long double arg );
logb(C99) double logb( double arg );
logbf(C99) float logbf( float arg );
logbl(C99) long double logbl( long double arg );
modf double modf( double arg , double* iptr );
modff(C99) float modff( float arg , float* iptr );
modfl(C99) long double modfl( long double arg , long double * iptr );
scalbn(C99) double scalbn( double arg , int exp );
scalbnf(C99) float scalbnf( float arg , int exp );
scalbnl(C99) long double scalbnl( long double arg , int exp );
scalbln(C99) double scalbln( double arg , long exp );
scalblnf(C99) float scalblnf( float arg , long exp );
scalblnl(C99) long double scalblnl( long double arg , long exp );

Power and Absolute-value Functions:
x, y, arg - floating point value
base - base as floating point value
exponent - exponent as floating point value

pow double pow( double base, double exponent );
powf(C99) float powf( float base, float exponent );
powl(C99) long double powl( long double base, long double exponent );
sqrt double sqrt( double arg );
sqrtf(C99) float sqrtf( float arg );
sqrtl(C99) long double sqrtl( long double arg );
cbrt(C99) double cbrt( double arg );
cbrtf(C99) float cbrtf( float arg );
cbrtl(C99) long double cbrtl( long double arg );
hypot(C99) double hypot( double x, double y );
hypotf(C99) float hypotf( float x, float y );
hypotl(C99) long double hypotl( long double x, long double y );
fabs double fabs( double arg );
fabsf(C99) float fabsf( float arg );
fabsl(C99) long double fabsl( long double arg );

Error and Gamma Functions:
arg - floating point value

erf(C99) double erf( double arg );
erff(C99) float erff( float arg );
erfl(C99) long double erfl( long double arg );
erfc(C99) double erfc( double arg );
erfcf(C99) float erfcf( float arg );
erfcl(C99) long double erfcl( long double arg );
tgamma(C99) double tgamma( double arg );
tgammaf(C99) float tgammaf( float arg );
tgammal(C99) long double tgammal( long double arg );
lgamma(C99) double lgamma( double arg );
lgammaf(C99) float lgammaf( float arg );
lgammal(C99) long double lgammal( long double arg );

Nearest Integer Functions:
arg - floating point value

ceil double ceil( double arg );
ceilf(C99) float ceilf( float arg );
ceill(C99) long double ceill( long double arg );
floor double floor( double arg );
floorf(C99) float floorf( float arg );
floorl(C99) long double floorl( long double arg );
trunc(C99) double trunc( double arg );
truncf(C99) float truncf( float arg );
truncl(C99) long double truncl( long double arg );
round(C99) double round( double arg );
roundf(C99) float roundf( float arg );
roundl(C99) long double roundl( long double arg );
lround(C99) long lround( double arg );
lroundf(C99) long lroundf( float arg );
lroundl(C99) long lroundl( long double arg );
llround(C99) long long llround( double arg );
llroundf(C99) long long llroundf( float arg );
llroundl(C99) long long llroundl( long double arg );
nearbyint(C99) double nearbyint( double arg );
nearbyintf(C99) float nearbyintf( float arg );
nearbyintl(C99) long double nearbyintl( long double arg );
rint(C99) double rint( double arg );
rintf(C99) float rintf( float arg );
rintl(C99) long double rintl( long double arg );
lrint(C99) long lrint( double arg );
lrintf(C99) long lrintf( float arg );
lrintl(C99) long lrintl( long double arg );
llrint(C99) long long llrint( double arg );
llrintf(C99) long long llrintf( float arg );
llrintl(C99) long long llrintl( long double arg );

Remainder Functions:
x, y, arg - floating point value
quo - to store the sign and some bits of x/y

fmod double fmod( double x, double y );
fmodf(C99) float fmodf( float x, float y );
fmodl(C99) long double fmodl( long double x, long double y );
remainder(C99) double remainder( double x, double y );
remainderf(C99) float remainderf( float x, float y );
remainderl(C99) long double remainderl( long double x, long double y );
remquo(C99) double remquo( double x, double y, int *quo );
remquof(C99) float remquof( float x, float y, int *quo );
remquol(C99) long double remquol( long double x, long double y, int *quo );

Manipulation Functions:
x, y - floating point values
from, to - floating point values
arg - narrow character string identifying the contents of a NaN

nextafterv(C99) double nextafter( double from, double to );
nextafterf(C99) float nextafterf( float from, float to );
nextafterl(C99) long double nextafterl( long double from, long double to );
nexttoward(C99) double nexttoward( double from, long double to );
nexttowardf(C99) float nexttowardf( float from, long double to );
nexttowardl(C99) long double nexttowardl( long double from, long double to );
copysign(C99) double copysign( double x, double y );
copysignf(C99) float copysignf( float x, float y );
copysignl(C99) long double copysignl( long double x, long double y );
nan(C99) double nan( const char* arg );
nanf(C99) float nanf( const char* arg );
nanl(C99) long double nanl( const char* arg );

Maximum, Minimum, and Positive difference Functions:
x, y - floating point values

fmax(C99) double fmax( double x, double y );
fmaxf(C99) float fmaxf( float x, float y );
fmaxl(C99) long double fmaxl( long double x, long double y );
fmin(C99) double fmin( double x, double y );
fminf(C99) float fminf( float x, float y );
fminl(C99) long double fminl( long double x, long double y );
fdim(C99) double fdim( double x, double y );
fdimf(C99) float fdimf( float x, float y );
fdiml(C99) long double fdiml( long double x, long double y );

Floating multiply-add Functions:
x, y - floating point values

fma(C99) double fma( double x, double y, double z );
fmaf(C99) float fmaf( float x, float y, float z );
fmal(C99) long double fmal( long double x, long double y, long double z );

Classification macro Functions:
x - floating point values

fpclassify(C99) int fpclassify(real-floating x);
isfinite(C99) int isfinite(real-floating x);
isinf(C99) int isinf(real-floating x);
isnan(C99) int isnan(real-floating x);
isnormal(C99) int isnormal(real-floating x);
signbit(C99) int signbit(real-floating x);

Comparison macro Functions:
x, y - floating point values

isgreater(C99) int isgreater(real-floating x, real-floating y);
isgreaterequal(C99) int isgreaterequal(real-floating x, real-floating y);
isless(C99) int isless(real-floating x, real-floating y);
islessequal(C99) int islessequal(real-floating x, real-floating y);
islessgreater(C99) int islessgreater(real-floating x, real-floating y);
isunordered(C99) int isunordered(real-floating x, real-floating y);



Related topics:
Library Functions in C   |   Standard Library in C   |   Header Files in C   |   Functions in C   |   Keywords in C   |   Data Types in C   |   Pointers in C

List of topics: C Programming

No comments:

Post a Comment