MicrOS
math.h File Reference
#include <limits.h>
#include <float.h>
#include "errno.h"
#include "fenv.h"

Go to the source code of this file.

Classes

union  float_byte
 Type represent float value as array of bytes. More...
 
union  double_byte
 Type represent double value as array of bytes. More...
 
union  long_double_byte
 Type represent long double value as array of bytes. More...
 

Macros

#define M_E   2.7182818284590452354
 The base of natural logarithms. More...
 
#define M_LOG2E   1.4426950408889634074
 The logarithm to base 2 of M_E. More...
 
#define M_LOG10E   0.43429448190325182765
 The logarithm to base 10 of M_E. More...
 
#define M_LN2   0.69314718055994530942
 The natural logarithm of 2. More...
 
#define M_LN10   2.30258509299404568402
 The natural logarithm of 10. More...
 
#define M_PI   3.14159265358979323846
 Pi, the ratio of a circle’s circumference to its diameter. More...
 
#define M_PI_2   1.57079632679489661923
 Pi divided by two. More...
 
#define M_PI_4   0.78539816339744830962
 Pi divided by four. More...
 
#define M_1_PI   0.31830988618379067154
 The reciprocal of pi (1/pi). More...
 
#define M_2_PI   0.63661977236758134308
 Two times the reciprocal of pi. More...
 
#define M_2_SQRTPI   1.12837916709551257390
 Two times the reciprocal of the square root of pi. More...
 
#define M_SQRT2   1.41421356237309504880
 The square root of two. More...
 
#define M_SQRT1_2   0.70710678118654752440
 The reciprocal of the square root of two (also the square root of 1/2). More...
 
#define FP_INFINITE   0
 Positive or negative infinity (overflow). More...
 
#define FP_NAN   1
 Not-A-Number. More...
 
#define FP_ZERO   2
 Value of zero. More...
 
#define FP_SUBNORMAL   3
 Sub-normal value (underflow) More...
 
#define FP_NORMAL   4
 Normal value (none of the above). More...
 
#define FP_WTF   5
 In normal case this shouldn't be returned. More...
 
#define FP_ILOGB0   -2147483648
 Arg of ilogb is zero. More...
 
#define FP_ILOGBNAN   -2147483648
 Arg of ilogb is NaN. More...
 
#define MATH_ERRNO   1
 Indicates that floating-point operations use the variable errno to report errors. More...
 
#define MATH_ERREXCEPT   2
 Indicates that floating-point exceptions are used. More...
 
#define math_errhandling   _math_errhandling
 Macro to access _math_errhandling. More...
 
#define isgreater(x, y)   ((isnan(x) || isnan(y)) ? 0 : ( (x) > (y) ? 1 : 0 ))
 The isnan macro determines whether its argument value is a NaN. More...
 
#define isgreaterequal(x, y)   ((isnan(x) || isnan(y)) ? 0 : ( (x) >= (y) ? 1 : 0 ))
 Check if value x is greather than y. More...
 
#define isless(x, y)   ((isnan(x) || isnan(y)) ? 0 : ( (x) < (y) ? 1 : 0 ))
 Check if value x is less than y. More...
 
#define islessequal(x, y)   ((isnan(x) || isnan(y)) ? 0 : ( (x) <= (y) ? 1 : 0 ))
 Check if value x is less or equal than y. More...
 
#define islessgreater(x, y)   ((isnan(x) || isnan(y)) ? 0 : ( (x) < (y) || (x) > (y) ? 1 : 0 ))
 Check if value x is less or greather than y. More...
 
#define isunordered(x, y)   ((isnan(x) || isnan(y)) ? 1 : 0 ))
 Check if value x or y is unordered. More...
 
#define fpclasify(x)   (sizeof(x) == sizeof(double) ? __math_fpclasify(x) : (sizeof(x) == sizeof(float) ? __math_fpclasifyf(x) : __math_fpclasifyl(x)))
 Classify floating-point value. More...
 
#define isfinite(x)   ((fpclasify(x) == FP_NORMAL || fpclasify(x) == FP_ZERO ))
 Is finite. More...
 
#define isinf(x)   (fpclasify(x) == FP_INFINITE)
 Is infinity. More...
 
#define isnan(x)   (fpclasify(x) == FP_NAN)
 Is Not-A-Number. More...
 
#define isnormal(x)   (fpclasify(x) == FP_NORMAL)
 Is normal. More...
 
#define signbit(arg)   (sizeof(arg) == sizeof(double) ? __math_signbit(arg) : (sizeof(arg) == sizeof(float) ? __math_signbitf(arg) : __math_signbitl(arg)))
 The signbit macro determines whether the sign of its argument value is negative. More...
 
#define FP_FAST_FMA(x, y, z)   (fma(x, y, z))
 Multiply-add. More...
 
#define FP_FAST_FMAF(x, y, z)   (fmaf(x, y, z))
 Multiply-add. More...
 
#define FP_FAST_FMAL(x, y, z)   (fmal(x, y, z))
 Multiply-add. More...
 
#define NAN   (__math_NANf())
 Returns quiet NAN. More...
 
#define INFINITY   (__math_INFf())
 Returns infinity. More...
 
#define HUGE_VAL   (__math_INF())
 Returns infinity. More...
 
#define HUGE_VALF   (__math_INFf())
 Returns infinity. More...
 
#define HUGE_VALL   (__math_INFl())
 Returns infinity. More...
 

Typedefs

typedef float float_t
 Floating-point type. More...
 
typedef double double_t
 Floating-point type. More...
 

Functions

double cos (double x)
 Compute cosine. More...
 
float cosf (float x)
 Compute cosine. More...
 
long double cosl (long double x)
 Compute cosine. More...
 
double sin (double x)
 Compute cosine. More...
 
float sinf (float x)
 Compute cosine. More...
 
long double sinl (long double x)
 Compute cosine. More...
 
double tan (double x)
 Compute tangent. More...
 
float tanf (float x)
 Compute tangent. More...
 
long double tanl (long double x)
 Compute tangent. More...
 
double acos (double x)
 Compute arc cosine. More...
 
float acosf (float x)
 Compute arc cosine. More...
 
long double acosl (long double x)
 Compute arc cosine. More...
 
double asin (double x)
 Compute arc sine. More...
 
float asinf (float x)
 Compute arc sine. More...
 
long double asinl (long double x)
 Compute arc sine. More...
 
double atan (double x)
 Compute arc tangent. More...
 
float atanf (float x)
 Compute arc tangent. More...
 
long double atanl (long double x)
 Compute arc tangent. More...
 
double atan2 (double x, double y)
 Compute arc tangent with two parameters. More...
 
float atan2f (float x, float y)
 Compute arc tangent with two parameters. More...
 
long double atan2l (long double x, long double y)
 Compute arc tangent with two parameters. More...
 
double cosh (double x)
 Compute hyperbolic cosine. More...
 
float coshf (float x)
 Compute hyperbolic cosine. More...
 
long double coshl (long double x)
 Compute hyperbolic cosine. More...
 
double sinh (double x)
 Compute hyperbolic sine. More...
 
float sinhf (float x)
 Compute hyperbolic sine. More...
 
long double sinhl (long double x)
 Compute hyperbolic sine. More...
 
double tanh (double x)
 Compute hyperbolic tangent. More...
 
float tanhf (float x)
 Compute hyperbolic tangent. More...
 
long double tanhl (long double x)
 Compute hyperbolic tangent. More...
 
double acosh (double x)
 Compute area hyperbolic cosine. More...
 
float acoshf (float x)
 Compute area hyperbolic cosine. More...
 
long double acoshl (long double x)
 Compute area hyperbolic cosine. More...
 
double asinh (double x)
 Compute area hyperbolic sine. More...
 
float asinhf (float x)
 Compute area hyperbolic sine. More...
 
long double asinhl (long double x)
 Compute area hyperbolic sine. More...
 
double atanh (double x)
 Compute area hyperbolic tangent. More...
 
float atanhf (float x)
 Compute area hyperbolic tangent. More...
 
long double atanhl (long double x)
 Compute area hyperbolic tangent. More...
 
double exp (double x)
 Compute exponential function. More...
 
float expf (float x)
 Compute exponential function. More...
 
long double expl (long double x)
 Compute exponential function. More...
 
double frexp (double x, int *exp)
 Get significand and exponent. More...
 
float frexpf (float x, int *exp)
 Get significand and exponent. More...
 
long double frexpl (long double x, int *exp)
 Get significand and exponent. More...
 
double ldexp (double x, int exp)
 Generate value from significand and exponent. More...
 
float ldexpf (float x, int exp)
 Generate value from significand and exponent. More...
 
long double ldexpl (long double x, int exp)
 Generate value from significand and exponent. More...
 
double log (double x)
 Compute natural logarithm. More...
 
float logf (float x)
 Compute natural logarithm. More...
 
long double logl (long double x)
 Compute natural logarithm. More...
 
double log10 (double x)
 Compute 10 based logarithm. More...
 
float log10f (float x)
 Compute 10 based logarithm. More...
 
long double log10l (long double x)
 Compute 10 based logarithm. More...
 
double modf (double x, double *iptr)
 Break into fractional and integral parts. More...
 
float modff (float x, float *iptr)
 Break into fractional and integral parts. More...
 
long double modfl (long double x, long double *iptr)
 Break into fractional and integral parts. More...
 
double exp2 (double x)
 Compute exponential function 2 based. More...
 
float exp2f (float x)
 Compute exponential function 2 based. More...
 
long double exp2l (long double x)
 Compute exponential function 2 based. More...
 
double expm1 (double x)
 Compute exponential function minus 1. More...
 
float expm1f (float x)
 Compute exponential function minus 1. More...
 
long double expm1l (long double x)
 Compute exponential function minus 1. More...
 
int ilogb (double x)
 Integer binary logarithm. More...
 
int ilogbf (float x)
 Integer binary logarithm. More...
 
int ilogbl (long double x)
 Integer binary logarithm. More...
 
double log1p (double x)
 Compute natural logarithm of value + 1. More...
 
float log1pf (float x)
 Compute natural logarithm of value + 1. More...
 
long double log1pl (long double x)
 Compute natural logarithm of value + 1. More...
 
double log2 (double x)
 Compute 2 based logarithm. More...
 
float log2f (float x)
 Compute 2 based logarithm. More...
 
long double log2l (long double x)
 Compute 2 based logarithm. More...
 
double logb (double x)
 Compute logarithm using FLT_RADIX. More...
 
float logbf (float x)
 Compute logarithm using FLT_RADIX. More...
 
long double logbl (long double x)
 Compute logarithm using FLT_RADIX. More...
 
double scalbn (double x, int n)
 Scale significand using floating-point base exponent. More...
 
float scalbnf (float x, int n)
 Scale significand using floating-point base exponent. More...
 
long double scalbnl (long double x, int n)
 Scale significand using floating-point base exponent. More...
 
double scalbln (double x, long int n)
 Scale significand using floating-point base exponent. More...
 
float scalblnf (float x, long int n)
 Scale significand using floating-point base exponent. More...
 
long double scalblnl (long double x, long int n)
 Scale significand using floating-point base exponent. More...
 
double pow (double base, double exponent)
 Compute power. More...
 
float powf (float base, float exponent)
 Compute power. More...
 
long double powl (long double base, long double exponent)
 Compute power. More...
 
double sqrt (double x)
 Compute square root. More...
 
float sqrtf (float x)
 Compute square root. More...
 
long double sqrtl (long double x)
 Compute square root. More...
 
double cbrt (double x)
 Compute cubic root. More...
 
float cbrtf (float x)
 Compute cubic root. More...
 
long double cbrtl (long double x)
 Compute cubic root. More...
 
double hypot (double x, double y)
 Compute hypotenuse. More...
 
float hypotf (float x, float y)
 Compute hypotenuse. More...
 
long double hypotl (long double x, long double y)
 Compute hypotenuse. More...
 
double erf (double x)
 Compute error function. More...
 
float erff (float x)
 Compute error function. More...
 
long double erfl (long double x)
 Compute error function. More...
 
double erfc (double x)
 Compute complementary error function. More...
 
float erfcf (float x)
 Compute complementary error function. More...
 
long double erfcl (long double x)
 Compute complementary error function. More...
 
double tgamma (double x)
 Compute gamma function. More...
 
float tgammaf (float x)
 Compute gamma function. More...
 
long double tgammal (long double x)
 Compute gamma function. More...
 
double lgamma (double x)
 Compute gamma function. More...
 
float lgammaf (float x)
 Compute gamma function. More...
 
long double lgammal (long double x)
 Compute gamma function. More...
 
double ceil (double x)
 Round up value. More...
 
float ceilf (float x)
 Round up value. More...
 
long double ceill (long double x)
 Round up value. More...
 
double floor (double x)
 Round down value. More...
 
float floorf (float x)
 Round down value. More...
 
long double floorl (long double x)
 Round down value. More...
 
double fmod (double numer, double denom)
 Compute remainder of division. More...
 
float fmodf (float numer, float denom)
 Compute remainder of division. More...
 
long double fmodl (long double numer, long double denom)
 Compute remainder of division. More...
 
double trunc (double x)
 Truncate value. More...
 
float truncf (float x)
 Truncate value. More...
 
long double truncl (long double x)
 Truncate value. More...
 
double round (double x)
 Round to nearest. More...
 
float roundf (float x)
 Round to nearest. More...
 
long double roundl (long double x)
 Round to nearest. More...
 
long int lround (double x)
 Round to nearest and cast to long integer. More...
 
long int lroundf (float x)
 Round to nearest and cast to long integer. More...
 
long int lroundl (long double x)
 Round to nearest and cast to long integer. More...
 
long long int llround (double x)
 Round to nearest and cast to long long integer. More...
 
long long int llroundf (float x)
 Round to nearest and cast to long long integer. More...
 
long long int llroundl (long double x)
 Round to nearest and cast to long long integer. More...
 
double rint (double x)
 Round to integral value. More...
 
float rintf (float x)
 Round to integral value. More...
 
long double rintl (long double x)
 Round to integral value. More...
 
long int lrint (double x)
 Round and cast to long integer. More...
 
long int lrintf (float x)
 Round and cast to long integer. More...
 
long int lrintl (long double x)
 Round and cast to long integer. More...
 
long long int llrint (double x)
 Round and cast to long long integer. More...
 
long long int llrintf (float x)
 Round and cast to long long integer. More...
 
long long int llrintl (long double x)
 Round and cast to long long integer. More...
 
double nearbyint (double x)
 Round to nearby integral value. More...
 
float nearbyintf (float x)
 Round to nearby integral value. More...
 
long double nearbyintl (long double x)
 Round to nearby integral value. More...
 
double remainder (double x, double y)
 Compute reminder required by IEC 60559. More...
 
float remainderf (float x, float y)
 Compute reminder required by IEC 60559. More...
 
long double remainderl (long double x, long double y)
 Compute reminder required by IEC 60559. More...
 
double remquo (double numer, double denom, int *quot)
 Compute remainder and quotient. More...
 
float remquof (float numer, float denom, int *quot)
 Compute remainder and quotient. More...
 
long double remquol (long double numer, long double denom, int *quot)
 Compute remainder and quotient. More...
 
double copysign (double x, double y)
 Copy sign. More...
 
float copysignf (float x, float y)
 Copy sign. More...
 
long double copysignl (long double x, long double y)
 Copy sign. More...
 
double nan (const char *arg)
 Generate quiet NaN. More...
 
float nanf (const char *arg)
 Generate quiet NaN. More...
 
long double nanl (const char *arg)
 Generate quiet NaN. More...
 
double nextafter (double x, double y)
 Next representable value. More...
 
float nextafterf (float x, float y)
 Next representable value. More...
 
long double nextafterl (long double x, long double y)
 Next representable value. More...
 
double nexttoward (double x, long double y)
 Next representable value toward precise value. More...
 
float nexttowardf (float x, long double y)
 Next representable value toward precise value. More...
 
long double nexttowardl (long double x, long double y)
 Next representable value toward precise value. More...
 
double fdim (double x, double y)
 Positive difference. More...
 
float fdimf (float x, float y)
 Positive difference. More...
 
long double fdiml (long double x, long double y)
 Positive difference. More...
 
double fmax (double x, double y)
 Higher value. More...
 
float fmaxf (float x, float y)
 Higher value. More...
 
long double fmaxl (long double x, long double y)
 Higher value. More...
 
double fmin (double x, double y)
 Lower value. More...
 
float fminf (float x, float y)
 Lower value. More...
 
long double fminl (long double x, long double y)
 Lower value. More...
 
double fabs (double x)
 Compute absolute value. More...
 
float fabsf (float x)
 Compute absolute value. More...
 
long double fabsl (long double x)
 Compute absolute value. More...
 
double fma (double x, double y, double z)
 Multiply-add. More...
 
float fmaf (float x, float y, float z)
 Multiply-add. More...
 
long double fmal (long double x, long double y, long double z)
 Multiply-add. More...
 
int __math_fpclasify (double x)
 Classify floating-point value. More...
 
int __math_fpclasifyf (float x)
 Classify floating-point value. More...
 
int __math_fpclasifyl (long double x)
 Classify floating-point value. More...
 
int __math_signbit (double x)
 The signbit determines whether the sign of its argument value is negative. More...
 
int __math_signbitf (float x)
 The signbit determines whether the sign of its argument value is negative. More...
 
int __math_signbitl (long double x)
 The signbit determines whether the sign of its argument value is negative. More...
 
float __math_NANf ()
 Returns quiet NAN. More...
 
double __math_INF ()
 Returns infinity. More...
 
float __math_INFf ()
 Returns infinity. More...
 
long double __math_INFl ()
 Returns infinity. More...
 

Variables

int _math_errhandling
 Expands to an expression of type int that is either equal to MATH_ERRNO, or equal to MATH_ERREXCEPT, or equal to their bitwise OR (MATH_ERRNO | MATH_ERREXCEPT). More...
 

Macro Definition Documentation

◆ FP_FAST_FMA

#define FP_FAST_FMA (   x,
  y,
 
)    (fma(x, y, z))

Multiply-add.

Compute (x × y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the current rounding mode. A range error may occur.

Parameters
xValue to be multiplied.
yValue to be multiplied.
zValue to be added.
Returns
Return (x × y) + z, rounded as one ternary operation.

◆ FP_FAST_FMAF

#define FP_FAST_FMAF (   x,
  y,
 
)    (fmaf(x, y, z))

Multiply-add.

Compute (x × y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the current rounding mode. A range error may occur.

Parameters
xValue to be multiplied.
yValue to be multiplied.
zValue to be added.
Returns
Return (x × y) + z, rounded as one ternary operation.

◆ FP_FAST_FMAL

#define FP_FAST_FMAL (   x,
  y,
 
)    (fmal(x, y, z))

Multiply-add.

Compute (x × y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the current rounding mode. A range error may occur.

Parameters
xValue to be multiplied.
yValue to be multiplied.
zValue to be added.
Returns
Return (x × y) + z, rounded as one ternary operation.

◆ FP_ILOGB0

#define FP_ILOGB0   -2147483648

Arg of ilogb is zero.

◆ FP_ILOGBNAN

#define FP_ILOGBNAN   -2147483648

Arg of ilogb is NaN.

◆ FP_INFINITE

#define FP_INFINITE   0

Positive or negative infinity (overflow).

◆ FP_NAN

#define FP_NAN   1

Not-A-Number.

◆ FP_NORMAL

#define FP_NORMAL   4

Normal value (none of the above).

◆ FP_SUBNORMAL

#define FP_SUBNORMAL   3

Sub-normal value (underflow)

◆ FP_WTF

#define FP_WTF   5

In normal case this shouldn't be returned.

◆ FP_ZERO

#define FP_ZERO   2

Value of zero.

◆ fpclasify

#define fpclasify (   x)    (sizeof(x) == sizeof(double) ? __math_fpclasify(x) : (sizeof(x) == sizeof(float) ? __math_fpclasifyf(x) : __math_fpclasifyl(x)))

Classify floating-point value.

Returns a value of type int that matches one of the classification macro constants, depending on the value of x.

Parameters
xThe value to classify.
Returns
One of the followoing int values: FP_INFINITE, FP_NAN, FP_ZERO, FP_SUBNORMAL, FP_NORMAL, FP_WTF.

◆ HUGE_VAL

#define HUGE_VAL   (__math_INF())

Returns infinity.

Returns
Infinity.

◆ HUGE_VALF

#define HUGE_VALF   (__math_INFf())

Returns infinity.

Returns
Infinity.

◆ HUGE_VALL

#define HUGE_VALL   (__math_INFl())

Returns infinity.

Returns
Infinity.

◆ INFINITY

#define INFINITY   (__math_INFf())

Returns infinity.

Returns
Infinity.

◆ isfinite

#define isfinite (   x)    ((fpclasify(x) == FP_NORMAL || fpclasify(x) == FP_ZERO ))

Is finite.

Returns whether x is a finite value. A finite value is any floating-point value that is neither infinite nor NaN (Not-A-Number).

Parameters
xThe value to check.
Returns
1 if true, 0 if false

◆ isgreater

#define isgreater (   x,
 
)    ((isnan(x) || isnan(y)) ? 0 : ( (x) > (y) ? 1 : 0 ))

The isnan macro determines whether its argument value is a NaN.

The isgreater macro determines whether its first argument is greater than its second argument. The value of isgreater(x, y) is always equal to (x) > (y); however, unlike (x) > (y), isgreater(x, y) does not raise the ‘‘invalid’’ floating-point exception when x and y are unordered.

Parameters
xFirst value.
ySecond value.
Returns
The isgreater macro returns the value of (x) > (y).

◆ isgreaterequal

#define isgreaterequal (   x,
 
)    ((isnan(x) || isnan(y)) ? 0 : ( (x) >= (y) ? 1 : 0 ))

Check if value x is greather than y.

The isgreaterequal macro determines whether its first argument is greater than or equal to its second argument. The value of isgreaterequal(x, y) is always equal to (x) >= (y); howev er, unlike (x) >= (y), isgreaterequal(x, y) does not raise the ‘‘invalid’’ floating-point exception when x and y are unordered.

Parameters
xFirst value.
ySecond value.
Returns
The isgreaterequal macro returns the value of (x) >= (y).

◆ isinf

#define isinf (   x)    (fpclasify(x) == FP_INFINITE)

Is infinity.

Returns whether x is an infinity value (either positive infinity or negative infinity).

Parameters
xThe value to check.
Returns
1 if true, 0 if false

◆ isless

#define isless (   x,
 
)    ((isnan(x) || isnan(y)) ? 0 : ( (x) < (y) ? 1 : 0 ))

Check if value x is less than y.

The isless macro determines whether its first argument is less than its second argument. The value of isless(x, y) is always equal to (x) < (y); however, unlike (x) < (y), isless(x, y) does not raise the ‘‘invalid’’ floating-point exception when x and y are unordered.

Parameters
xFirst value.
ySecond value.
Returns
The isless macro returns the value of (x) < (y).

◆ islessequal

#define islessequal (   x,
 
)    ((isnan(x) || isnan(y)) ? 0 : ( (x) <= (y) ? 1 : 0 ))

Check if value x is less or equal than y.

The islessequal macro determines whether its first argument is less than or equal to its second argument. The value of islessequal(x, y) is always equal to(x) <= (y); however, unlike (x) <= (y), islessequal(x, y) does not raise the ‘‘invalid’’ floating-point exception when x and y are unordered.

Parameters
xFirst value.
ySecond value.
Returns
The islessequal macro returns the value of (x) <= (y).

◆ islessgreater

#define islessgreater (   x,
 
)    ((isnan(x) || isnan(y)) ? 0 : ( (x) < (y) || (x) > (y) ? 1 : 0 ))

Check if value x is less or greather than y.

The islessgreater macro determines whether its first argument is less than or greater than its second argument. The islessgreater(x, y) macro is similar to (x) < (y) || (x) > (y); however, islessgreater(x, y) does not raise the ‘‘invalid’’ floating-point exception when x and y are unordered (nor does it evaluate x and y twice).

Parameters
xFirst value.
ySecond value.
Returns
The islessgreater macro returns the value of (x) < (y) || (x) > (y).

◆ isnan

#define isnan (   x)    (fpclasify(x) == FP_NAN)

Is Not-A-Number.

Returns whether x is a NaN (Not-A-Number) value.

Parameters
xThe value to check.
Returns
1 if true, 0 if false

◆ isnormal

#define isnormal (   x)    (fpclasify(x) == FP_NORMAL)

Is normal.

Returns whether x is a normal value: i.e., whether it is neither infinity, NaN, zero or subnormal.

Parameters
xThe value to check.
Returns
1 if true, 0 if false

◆ isunordered

#define isunordered (   x,
 
)    ((isnan(x) || isnan(y)) ? 1 : 0 ))

Check if value x or y is unordered.

The isunordered macro determines whether its arguments are unordered.

Parameters
xFirst value.
ySecond value.
Returns
The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.

◆ M_1_PI

#define M_1_PI   0.31830988618379067154

The reciprocal of pi (1/pi).

◆ M_2_PI

#define M_2_PI   0.63661977236758134308

Two times the reciprocal of pi.

◆ M_2_SQRTPI

#define M_2_SQRTPI   1.12837916709551257390

Two times the reciprocal of the square root of pi.

◆ M_E

#define M_E   2.7182818284590452354

The base of natural logarithms.

◆ M_LN10

#define M_LN10   2.30258509299404568402

The natural logarithm of 10.

◆ M_LN2

#define M_LN2   0.69314718055994530942

The natural logarithm of 2.

◆ M_LOG10E

#define M_LOG10E   0.43429448190325182765

The logarithm to base 10 of M_E.

◆ M_LOG2E

#define M_LOG2E   1.4426950408889634074

The logarithm to base 2 of M_E.

◆ M_PI

#define M_PI   3.14159265358979323846

Pi, the ratio of a circle’s circumference to its diameter.

◆ M_PI_2

#define M_PI_2   1.57079632679489661923

Pi divided by two.

◆ M_PI_4

#define M_PI_4   0.78539816339744830962

Pi divided by four.

◆ M_SQRT1_2

#define M_SQRT1_2   0.70710678118654752440

The reciprocal of the square root of two (also the square root of 1/2).

◆ M_SQRT2

#define M_SQRT2   1.41421356237309504880

The square root of two.

◆ MATH_ERREXCEPT

#define MATH_ERREXCEPT   2

Indicates that floating-point exceptions are used.

◆ math_errhandling

#define math_errhandling   _math_errhandling

Macro to access _math_errhandling.

The macro constant math_errhandling expands to an expression of type int that is either equal to MATH_ERRNO, or equal to MATH_ERREXCEPT, or equal to their bitwise OR (MATH_ERRNO | MATH_ERREXCEPT).

◆ MATH_ERRNO

#define MATH_ERRNO   1

Indicates that floating-point operations use the variable errno to report errors.

◆ NAN

#define NAN   (__math_NANf())

Returns quiet NAN.

Returns
Quiet NAN.

◆ signbit

#define signbit (   arg)    (sizeof(arg) == sizeof(double) ? __math_signbit(arg) : (sizeof(arg) == sizeof(float) ? __math_signbitf(arg) : __math_signbitl(arg)))

The signbit macro determines whether the sign of its argument value is negative.

Parameters
argThe value to check.
Returns
The signbit macro returns a nonzero value if and only if the sign of its argument value is negative.

Typedef Documentation

◆ double_t

typedef double double_t

Floating-point type.

Alias of one of the fundamental floating-point types at least as wide as double.

◆ float_t

typedef float float_t

Floating-point type.

Alias of one of the fundamental floating-point types at least as wide as float.

Function Documentation

◆ __math_fpclasify()

int __math_fpclasify ( double  x)

Classify floating-point value.

Returns a value of type int that matches one of the classification macro constants, depending on the value of x.

Parameters
xThe value to classify.
Returns
One of the followoing int values: FP_INFINITE, FP_NAN, FP_ZERO, FP_SUBNORMAL, FP_NORMAL, FP_WTF.

◆ __math_fpclasifyf()

int __math_fpclasifyf ( float  x)

Classify floating-point value.

Returns a value of type int that matches one of the classification macro constants, depending on the value of x.

Parameters
xThe value to classify.
Returns
One of the followoing int values: FP_INFINITE, FP_NAN, FP_ZERO, FP_SUBNORMAL, FP_NORMAL, FP_WTF.

◆ __math_fpclasifyl()

int __math_fpclasifyl ( long double  x)

Classify floating-point value.

Returns a value of type int that matches one of the classification macro constants, depending on the value of x.

Parameters
xThe value to classify.
Returns
One of the followoing int values: FP_INFINITE, FP_NAN, FP_ZERO, FP_SUBNORMAL, FP_NORMAL, FP_WTF.

◆ __math_INF()

double __math_INF ( )

Returns infinity.

Returns
Infinity.

◆ __math_INFf()

float __math_INFf ( )

Returns infinity.

Returns
Infinity.

◆ __math_INFl()

long double __math_INFl ( )

Returns infinity.

Returns
Infinity.

◆ __math_NANf()

float __math_NANf ( )

Returns quiet NAN.

Returns
Quiet NAN.

◆ __math_signbit()

int __math_signbit ( double  x)

The signbit determines whether the sign of its argument value is negative.

Parameters
argThe value to check.
Returns
The signbit returns a nonzero value if and only if the sign of its argument value is negative.

◆ __math_signbitf()

int __math_signbitf ( float  x)

The signbit determines whether the sign of its argument value is negative.

Parameters
argThe value to check.
Returns
The signbit returns a nonzero value if and only if the sign of its argument value is negative.

◆ __math_signbitl()

int __math_signbitl ( long double  x)

The signbit determines whether the sign of its argument value is negative.

Parameters
argThe value to check.
Returns
The signbit returns a nonzero value if and only if the sign of its argument value is negative.

◆ acos()

double acos ( double  x)

Compute arc cosine.

The acos functions compute the principal value of the arc cosine of x. A domain error occurs for arguments not in the interval [−1, +1].

Parameters
xValue whose arc cosine is computed, in the interval [-1,+1].
Returns
The acos functions return arccos x in the interval [0,π ] radians.

◆ acosf()

float acosf ( float  x)

Compute arc cosine.

The acosf functions compute the principal value of the arc cosine of x. A domain error occurs for arguments not in the interval [−1, +1].

Parameters
xValue whose arc cosine is computed, in the interval [-1,+1].
Returns
The acosf functions return arccos x in the interval [0,π ] radians.

◆ acosh()

double acosh ( double  x)

Compute area hyperbolic cosine.

The acosh functions compute the (nonnegative) arc hyperbolic cosine of x. A domain error occurs for arguments less than 1.

Parameters
xValue whose area hyperbolic cosine is computed.
Returns
The acosh functions return arcosh x in the interval [0, +∞].

◆ acoshf()

float acoshf ( float  x)

Compute area hyperbolic cosine.

The acoshf functions compute the (nonnegative) arc hyperbolic cosine of x. A domain error occurs for arguments less than 1.

Parameters
xValue whose area hyperbolic cosine is computed.
Returns
The acoshf functions return arcosh x in the interval [0, +∞].

◆ acoshl()

long double acoshl ( long double  x)

Compute area hyperbolic cosine.

The acoshl functions compute the (nonnegative) arc hyperbolic cosine of x. A domain error occurs for arguments less than 1.

Parameters
xValue whose area hyperbolic cosine is computed.
Returns
The acoshl functions return arcosh x in the interval [0, +∞].

◆ acosl()

long double acosl ( long double  x)

Compute arc cosine.

The acosl functions compute the principal value of the arc cosine of x. A domain error occurs for arguments not in the interval [−1, +1].

Parameters
xValue whose arc cosine is computed, in the interval [-1,+1].
Returns
The acosl functions return arccos x in the interval [0,π ] radians.

◆ asin()

double asin ( double  x)

Compute arc sine.

The asin functions compute the principal value of the arc sine of x. A domain error occurs for arguments not in the interval [−1, +1].

Parameters
xValue whose arc cosine is computed, in the interval [-1,+1].
Returns
The asin functions return arcsin x in the interval [−π /2, +π /2] radians.

◆ asinf()

float asinf ( float  x)

Compute arc sine.

The asinf functions compute the principal value of the arc sine of x. A domain error occurs for arguments not in the interval [−1, +1].

Parameters
xValue whose arc cosine is computed, in the interval [-1,+1].
Returns
The asinf functions return arcsin x in the interval [−π /2, +π /2] radians.

◆ asinh()

double asinh ( double  x)

Compute area hyperbolic sine.

The asinh functions compute the arc hyperbolic sine of x.

Parameters
xValue whose area hyperbolic sine is computed.
Returns
The asinh functions return arsinh x.

◆ asinhf()

float asinhf ( float  x)

Compute area hyperbolic sine.

The asinhf functions compute the arc hyperbolic sine of x.

Parameters
xValue whose area hyperbolic sine is computed.
Returns
The asinhf functions return arsinh x.

◆ asinhl()

long double asinhl ( long double  x)

Compute area hyperbolic sine.

The asinhl functions compute the arc hyperbolic sine of x.

Parameters
xValue whose area hyperbolic sine is computed.
Returns
The asinhl functions return arsinh x.

◆ asinl()

long double asinl ( long double  x)

Compute arc sine.

The asinl functions compute the principal value of the arc sine of x. A domain error occurs for arguments not in the interval [−1, +1].

Parameters
xValue whose arc cosine is computed, in the interval [-1,+1].
Returns
The asinl functions return arcsin x in the interval [−π /2, +π /2] radians.

◆ atan()

double atan ( double  x)

Compute arc tangent.

The atan functions compute the principal value of the arc tangent of x.

Parameters
xValue whose arc tangent is computed.
Returns
The atan functions return arctan x in the interval [−π /2, +π /2] radians.

◆ atan2()

double atan2 ( double  x,
double  y 
)

Compute arc tangent with two parameters.

The atan2 functions compute the value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. A domain error may occur if both arguments are zero.

Parameters
xValue representing the proportion of the y-coordinate.
yValue representing the proportion of the x-coordinate.
Returns
The atan2 functions return arctan y/x in the interval [−π , +π ] radians.

◆ atan2f()

float atan2f ( float  x,
float  y 
)

Compute arc tangent with two parameters.

The atan2f functions compute the value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. A domain error may occur if both arguments are zero.

Parameters
xValue representing the proportion of the y-coordinate.
yValue representing the proportion of the x-coordinate.
Returns
The atan2f functions return arctan y/x in the interval [−π , +π ] radians.

◆ atan2l()

long double atan2l ( long double  x,
long double  y 
)

Compute arc tangent with two parameters.

The atan2l functions compute the value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. A domain error may occur if both arguments are zero.

Parameters
xValue representing the proportion of the y-coordinate.
yValue representing the proportion of the x-coordinate.
Returns
The atan2l functions return arctan y/x in the interval [−π , +π ] radians.

◆ atanf()

float atanf ( float  x)

Compute arc tangent.

The atanf functions compute the principal value of the arc tangent of x.

Parameters
xValue whose arc tangent is computed.
Returns
The atanf functions return arctan x in the interval [−π /2, +π /2] radians.

◆ atanh()

double atanh ( double  x)

Compute area hyperbolic tangent.

The atanh functions compute the arc hyperbolic tangent of x. A domain error occurs for arguments not in the interval [−1, +1]. A pole error may occur if the argument equals −1 or +1.

Parameters
xValue whose area hyperbolic tangent is computed, in the interval [-1,+1].
Returns
The atanh functions return artanh x.

◆ atanhf()

float atanhf ( float  x)

Compute area hyperbolic tangent.

The atanhf functions compute the arc hyperbolic tangent of x. A domain error occurs for arguments not in the interval [−1, +1]. A pole error may occur if the argument equals −1 or +1.

Parameters
xValue whose area hyperbolic tangent is computed, in the interval [-1,+1].
Returns
The atanhf functions return artanh x.

◆ atanhl()

long double atanhl ( long double  x)

Compute area hyperbolic tangent.

The atanhl functions compute the arc hyperbolic tangent of x. A domain error occurs for arguments not in the interval [−1, +1]. A pole error may occur if the argument equals −1 or +1.

Parameters
xValue whose area hyperbolic tangent is computed, in the interval [-1,+1].
Returns
The atanhl functions return artanh x.

◆ atanl()

long double atanl ( long double  x)

Compute arc tangent.

The atanl functions compute the principal value of the arc tangent of x.

Parameters
xValue whose arc tangent is computed.
Returns
The atanl functions return arctan x in the interval [−π /2, +π /2] radians.

◆ cbrt()

double cbrt ( double  x)

Compute cubic root.

The cbrt functions compute the cubic root of x.

Parameters
xValue whose cubic root is computed.
Returns
The cbrt functions return 3√x.

◆ cbrtf()

float cbrtf ( float  x)

Compute cubic root.

The cbrtf functions compute the cubic root of x.

Parameters
xValue whose cubic root is computed.
Returns
The cbrtf functions return 3√x.

◆ cbrtl()

long double cbrtl ( long double  x)

Compute cubic root.

The cbrtl functions compute the cubic root of x.

Parameters
xValue whose cubic root is computed.
Returns
The cbrtl functions return 3√x.

◆ ceil()

double ceil ( double  x)

Round up value.

The ceil functions compute the smallest integer value not less than x.

Parameters
xValue to round up.
Returns
The ceil functions return ⎡x⎤, expressed as a floating-point number.

◆ ceilf()

float ceilf ( float  x)

Round up value.

The ceilf functions compute the smallest integer value not less than x.

Parameters
xValue to round up.
Returns
The ceilf functions return ⎡x⎤, expressed as a floating-point number.

◆ ceill()

long double ceill ( long double  x)

Round up value.

The ceill functions compute the smallest integer value not less than x.

Parameters
xValue to round up.
Returns
The ceill functions return ⎡x⎤, expressed as a floating-point number.

◆ copysign()

double copysign ( double  x,
double  y 
)

Copy sign.

The copysign functions produce a value with the magnitude of x and the sign of y. They produce a NaN (with the sign of y) if x is a NaN. On implementations that represent a signed zero but do not treat negative zero consistently in arithmetic operations, the copysign functions regard the sign of zero as positive.

Parameters
xValue with the magnitude of the resulting value.
yValue with the sign of the resulting value.
Returns
The copysign functions return a value with the magnitude of x and the sign of y.

◆ copysignf()

float copysignf ( float  x,
float  y 
)

Copy sign.

The copysignf functions produce a value with the magnitude of x and the sign of y. They produce a NaN (with the sign of y) if x is a NaN. On implementations that represent a signed zero but do not treat negative zero consistently in arithmetic operations, the copysign functions regard the sign of zero as positive.

Parameters
xValue with the magnitude of the resulting value.
yValue with the sign of the resulting value.
Returns
The copysignf functions return a value with the magnitude of x and the sign of y.

◆ copysignl()

long double copysignl ( long double  x,
long double  y 
)

Copy sign.

The copysignl functions produce a value with the magnitude of x and the sign of y. They produce a NaN (with the sign of y) if x is a NaN. On implementations that represent a signed zero but do not treat negative zero consistently in arithmetic operations, the copysign functions regard the sign of zero as positive.

Parameters
xValue with the magnitude of the resulting value.
yValue with the sign of the resulting value.
Returns
The copysignl functions return a value with the magnitude of x and the sign of y.

◆ cos()

double cos ( double  x)

Compute cosine.

The cos functions compute the cosine of x (measured in radians).

Parameters
xValue representing an angle expressed in radians.
Returns
Cosine of x radians.

◆ cosf()

float cosf ( float  x)

Compute cosine.

The cosf functions compute the cosine of x (measured in radians).

Parameters
xValue representing an angle expressed in radians.
Returns
Cosine of x radians.

◆ cosh()

double cosh ( double  x)

Compute hyperbolic cosine.

The cosh functions compute the hyperbolic cosine of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue representing a hyperbolic angle.
Returns
The cosh functions return cosh x.

◆ coshf()

float coshf ( float  x)

Compute hyperbolic cosine.

The coshf functions compute the hyperbolic cosine of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue representing a hyperbolic angle.
Returns
The coshf functions return cosh x.

◆ coshl()

long double coshl ( long double  x)

Compute hyperbolic cosine.

The coshl functions compute the hyperbolic cosine of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue representing a hyperbolic angle.
Returns
The coshl functions return cosh x.

◆ cosl()

long double cosl ( long double  x)

Compute cosine.

The cosl functions compute the cosine of x (measured in radians).

Parameters
xValue representing an angle expressed in radians.
Returns
Cosine of x radians.

◆ erf()

double erf ( double  x)

Compute error function.

The erf functions compute the error function of x.

Parameters
xParameter for the error function.
Returns
Error function value for x.

◆ erfc()

double erfc ( double  x)

Compute complementary error function.

The erfc functions compute the complementary error function of x. A range error occurs if x is too large.

Parameters
xParameter for the complementary error function.
Returns
Complementary error function value for x.

◆ erfcf()

float erfcf ( float  x)

Compute complementary error function.

The erfcf functions compute the complementary error function of x. A range error occurs if x is too large.

Parameters
xParameter for the complementary error function.
Returns
Complementary error function value for x.

◆ erfcl()

long double erfcl ( long double  x)

Compute complementary error function.

The erfcl functions compute the complementary error function of x. A range error occurs if x is too large.

Parameters
xParameter for the complementary error function.
Returns
Complementary error function value for x.

◆ erff()

float erff ( float  x)

Compute error function.

The erff functions compute the error function of x.

Parameters
xParameter for the error function.
Returns
Error function value for x.

◆ erfl()

long double erfl ( long double  x)

Compute error function.

The erfl functions compute the error function of x.

Parameters
xParameter for the error function.
Returns
Error function value for x.

◆ exp()

double exp ( double  x)

Compute exponential function.

The exp functions compute the base-e exponential of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue of the exponent.
Returns
The exp functions return e^x.

◆ exp2()

double exp2 ( double  x)

Compute exponential function 2 based.

The exp2 functions compute the base-2 exponential of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue of the exponent.
Returns
The exp2 functions return 2^x.

◆ exp2f()

float exp2f ( float  x)

Compute exponential function 2 based.

The exp2f functions compute the base-2 exponential of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue of the exponent.
Returns
The exp2f functions return 2^x.

◆ exp2l()

long double exp2l ( long double  x)

Compute exponential function 2 based.

The exp2l functions compute the base-2 exponential of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue of the exponent.
Returns
The exp2l functions return 2^x.

◆ expf()

float expf ( float  x)

Compute exponential function.

The expf functions compute the base-e exponential of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue of the exponent.
Returns
The expf functions return e^x.

◆ expl()

long double expl ( long double  x)

Compute exponential function.

The expl functions compute the base-e exponential of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue of the exponent.
Returns
The expl functions return e^x.

◆ expm1()

double expm1 ( double  x)

Compute exponential function minus 1.

The expm1 functions compute the base-e exponential of the argument, minus 1. A range error occurs if x is too large.

Parameters
xValue of the exponent.
Returns
The expm1 functions return e^x − 1.

◆ expm1f()

float expm1f ( float  x)

Compute exponential function minus 1.

The expm1f functions compute the base-e exponential of the argument, minus 1. A range error occurs if x is too large.

Parameters
xValue of the exponent.
Returns
The expm1f functions return e^x − 1.

◆ expm1l()

long double expm1l ( long double  x)

Compute exponential function minus 1.

The expm1l functions compute the base-e exponential of the argument, minus 1. A range error occurs if x is too large.

Parameters
xValue of the exponent.
Returns
The expm1l functions return e^x − 1.

◆ fabs()

double fabs ( double  x)

Compute absolute value.

The fabs functions compute the absolute value of a floating-point number x.

Parameters
xValue among which the function selects a minimum.
Returns
The fabs functions return | x |.

◆ fabsf()

float fabsf ( float  x)

Compute absolute value.

The fabsf functions compute the absolute value of a floating-point number x.

Parameters
xValue among which the function selects a minimum.
Returns
The fabsf functions return | x |.

◆ fabsl()

long double fabsl ( long double  x)

Compute absolute value.

The fabsl functions compute the absolute value of a floating-point number x.

Parameters
xValue among which the function selects a minimum.
Returns
The fabsl functions return | x |.

◆ fdim()

double fdim ( double  x,
double  y 
)

Positive difference.

The fdim functions determine the positive difference between their arguments.

Parameters
xValue whose difference is calculated.
yValue whose difference is calculated.
Returns
The fdim functions return the positive difference value.

◆ fdimf()

float fdimf ( float  x,
float  y 
)

Positive difference.

The fdimf functions determine the positive difference between their arguments.

Parameters
xValue whose difference is calculated.
yValue whose difference is calculated.
Returns
The fdimf functions return the positive difference value.

◆ fdiml()

long double fdiml ( long double  x,
long double  y 
)

Positive difference.

The fdiml functions determine the positive difference between their arguments.

Parameters
xValue whose difference is calculated.
yValue whose difference is calculated.
Returns
The fdiml functions return the positive difference value.

◆ floor()

double floor ( double  x)

Round down value.

The floor functions compute the largest integer value not greater than x.

Parameters
xValue to round down.
Returns
The floor functions return ⎣x⎦, expressed as a floating-point number.

◆ floorf()

float floorf ( float  x)

Round down value.

The floorf functions compute the largest integer value not greater than x.

Parameters
xValue to round down.
Returns
The floorf functions return ⎣x⎦, expressed as a floating-point number.

◆ floorl()

long double floorl ( long double  x)

Round down value.

The floorl functions compute the largest integer value not greater than x.

Parameters
xValue to round down.
Returns
The floorl functions return ⎣x⎦, expressed as a floating-point number.

◆ fma()

double fma ( double  x,
double  y,
double  z 
)

Multiply-add.

The fma functions compute (x × y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the current rounding mode. A range error may occur.

Parameters
xValue to be multiplied.
yValue to be multiplied.
zValue to be added.
Returns
The fma functions return (x × y) + z, rounded as one ternary operation.

◆ fmaf()

float fmaf ( float  x,
float  y,
float  z 
)

Multiply-add.

The fmaf functions compute (x × y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the current rounding mode. A range error may occur.

Parameters
xValue to be multiplied.
yValue to be multiplied.
zValue to be added.
Returns
The fmaf functions return (x × y) + z, rounded as one ternary operation.

◆ fmal()

long double fmal ( long double  x,
long double  y,
long double  z 
)

Multiply-add.

The fmal functions compute (x × y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the current rounding mode. A range error may occur.

Parameters
xValue to be multiplied.
yValue to be multiplied.
zValue to be added.
Returns
The fmal functions return (x × y) + z, rounded as one ternary operation.

◆ fmax()

double fmax ( double  x,
double  y 
)

Higher value.

The fmax functions determine the maximum numeric value of their arguments.

Parameters
xValue among which the function selects a maximum.
yValue among which the function selects a maximum.
Returns
The fmax functions return the maximum numeric value of their arguments.

◆ fmaxf()

float fmaxf ( float  x,
float  y 
)

Higher value.

The fmaxf functions determine the maximum numeric value of their arguments.

Parameters
xValue among which the function selects a maximum.
yValue among which the function selects a maximum.
Returns
The fmaxf functions return the maximum numeric value of their arguments.

◆ fmaxl()

long double fmaxl ( long double  x,
long double  y 
)

Higher value.

The fmaxl functions determine the maximum numeric value of their arguments.

Parameters
xValue among which the function selects a maximum.
yValue among which the function selects a maximum.
Returns
The fmaxl functions return the maximum numeric value of their arguments.

◆ fmin()

double fmin ( double  x,
double  y 
)

Lower value.

The fmin functions determine the minimum numeric value of their arguments.

Parameters
xValue among which the function selects a minimum.
yValue among which the function selects a minimum.
Returns
The fmin functions return the minimum numeric value of their arguments.

◆ fminf()

float fminf ( float  x,
float  y 
)

Lower value.

The fminf functions determine the minimum numeric value of their arguments.

Parameters
xValue among which the function selects a minimum.
yValue among which the function selects a minimum.
Returns
The fminf functions return the minimum numeric value of their arguments.

◆ fminl()

long double fminl ( long double  x,
long double  y 
)

Lower value.

The fminl functions determine the minimum numeric value of their arguments.

Parameters
xValue among which the function selects a minimum.
yValue among which the function selects a minimum.
Returns
The fminl functions return the minimum numeric value of their arguments.

◆ fmod()

double fmod ( double  numer,
double  denom 
)

Compute remainder of division.

The fmod functions compute the floating-point remainder of x/y.

Parameters
numerValue of the quotient numerator.
denomValue of the quotient denominator.
Returns
The fmod functions return the value x − ny, for some integer n such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y. If y is zero, a domain error occurs and the fmod functions return zero.

◆ fmodf()

float fmodf ( float  numer,
float  denom 
)

Compute remainder of division.

The fmodf functions compute the floating-point remainder of x/y.

Parameters
numerValue of the quotient numerator.
denomValue of the quotient denominator.
Returns
The fmodf functions return the value x − ny, for some integer n such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y. If y is zero, a domain error occurs and the fmodf functions return zero.

◆ fmodl()

long double fmodl ( long double  numer,
long double  denom 
)

Compute remainder of division.

The fmodl functions compute the floating-point remainder of x/y.

Parameters
numerValue of the quotient numerator.
denomValue of the quotient denominator.
Returns
The fmodl functions return the value x − ny, for some integer n such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y. If y is zero, a domain error occurs and the fmod functions return zero.

◆ frexp()

double frexp ( double  x,
int *  exp 
)

Get significand and exponent.

The frexp functions break a floating-point number into a normalized fraction and an integral power of 2. They store the integer in the int object pointed to by exp.

Parameters
xValue to be decomposed.
expPointer to an int where the value of the exponent is stored.
Returns
If value is not a floating-point number or if the integral power of 2 is outside the range of int, the results are unspecified. Otherwise, the frexp functions return the value x, such that x has a magnitude in the interval [1/2, 1) or zero, and value equals x × 2^exp. If value is zero, both parts of the result are zero.

◆ frexpf()

float frexpf ( float  x,
int *  exp 
)

Get significand and exponent.

The frexpf functions break a floating-point number into a normalized fraction and an integral power of 2. They store the integer in the int object pointed to by exp.

Parameters
xValue to be decomposed.
expPointer to an int where the value of the exponent is stored.
Returns
If value is not a floating-point number or if the integral power of 2 is outside the range of int, the results are unspecified. Otherwise, the frexpf functions return the value x, such that x has a magnitude in the interval [1/2, 1) or zero, and value equals x × 2^exp. If value is zero, both parts of the result are zero.

◆ frexpl()

long double frexpl ( long double  x,
int *  exp 
)

Get significand and exponent.

The frexpl functions break a floating-point number into a normalized fraction and an integral power of 2. They store the integer in the int object pointed to by exp.

Parameters
xValue to be decomposed.
expPointer to an int where the value of the exponent is stored.
Returns
If value is not a floating-point number or if the integral power of 2 is outside the range of int, the results are unspecified. Otherwise, the frexp functions return the value x, such that x has a magnitude in the interval [1/2, 1) or zero, and value equals x × 2^exp. If value is zero, both parts of the result are zero.

◆ hypot()

double hypot ( double  x,
double  y 
)

Compute hypotenuse.

The hypot functions compute the square root of the sum of the squares of x and y, without undue overflow or underflow. A range error may occur.

Parameters
xFloating point value corresponding to the leg of a right-angled triangle for which the hypotenuse is computed.
yFloating point value corresponding to the leg of a right-angled triangle for which the hypotenuse is computed.
Returns
The hypot functions return √(x^2+y^2).

◆ hypotf()

float hypotf ( float  x,
float  y 
)

Compute hypotenuse.

The hypotf functions compute the square root of the sum of the squares of x and y, without undue overflow or underflow. A range error may occur.

Parameters
xFloating point value corresponding to the leg of a right-angled triangle for which the hypotenuse is computed.
yFloating point value corresponding to the leg of a right-angled triangle for which the hypotenuse is computed.
Returns
The hypotf functions return √(x^2+y^2).

◆ hypotl()

long double hypotl ( long double  x,
long double  y 
)

Compute hypotenuse.

The hypotl functions compute the square root of the sum of the squares of x and y, without undue overflow or underflow. A range error may occur.

Parameters
xFloating point value corresponding to the leg of a right-angled triangle for which the hypotenuse is computed.
yFloating point value corresponding to the leg of a right-angled triangle for which the hypotenuse is computed.
Returns
The hypotl functions return √(x^2+y^2).

◆ ilogb()

int ilogb ( double  x)

Integer binary logarithm.

The ilogb functions extract the exponent of x as a signed int value. If x is zero they compute the value FP_ILOGB0; if x is infinite they compute the value INT_MAX; if x is a NaN they compute the value FP_ILOGBNAN; otherwise, they are equivalent to calling the corresponding logb function and casting the returned value to type int. A domain error or range error may occur if x is zero, infinite, or NaN. If the correct value is outside the range of the return type, the numeric result is unspecified.

Parameters
xValue whose ilogb is returned.
Returns
The ilogb functions return the exponent of x as a signed int value.

◆ ilogbf()

int ilogbf ( float  x)

Integer binary logarithm.

The ilogbf functions extract the exponent of x as a signed int value. If x is zero they compute the value FP_ILOGB0; if x is infinite they compute the value INT_MAX; if x is a NaN they compute the value FP_ILOGBNAN; otherwise, they are equivalent to calling the corresponding logb function and casting the returned value to type int. A domain error or range error may occur if x is zero, infinite, or NaN. If the correct value is outside the range of the return type, the numeric result is unspecified.

Parameters
xValue whose ilogbf is returned.
Returns
The ilogbf functions return the exponent of x as a signed int value.

◆ ilogbl()

int ilogbl ( long double  x)

Integer binary logarithm.

The ilogbl functions extract the exponent of x as a signed int value. If x is zero they compute the value FP_ILOGB0; if x is infinite they compute the value INT_MAX; if x is a NaN they compute the value FP_ILOGBNAN; otherwise, they are equivalent to calling the corresponding logb function and casting the returned value to type int. A domain error or range error may occur if x is zero, infinite, or NaN. If the correct value is outside the range of the return type, the numeric result is unspecified.

Parameters
xValue whose ilogbl is returned.
Returns
The ilogbl functions return the exponent of x as a signed int value.

◆ ldexp()

double ldexp ( double  x,
int  exp 
)

Generate value from significand and exponent.

The ldexp functions multiply a floating-point number by an integral power of 2. A range error may occur.

Parameters
xGenerate value from significand and exponent
expValue of the exponent.
Returns
The ldexp functions return x * 2^exp.

◆ ldexpf()

float ldexpf ( float  x,
int  exp 
)

Generate value from significand and exponent.

The ldexpf functions multiply a floating-point number by an integral power of 2. A range error may occur.

Parameters
xGenerate value from significand and exponent
expValue of the exponent.
Returns
The ldexpf functions return x * 2^exp.

◆ ldexpl()

long double ldexpl ( long double  x,
int  exp 
)

Generate value from significand and exponent.

The ldexpl functions multiply a floating-point number by an integral power of 2. A range error may occur.

Parameters
xGenerate value from significand and exponent
expValue of the exponent.
Returns
The ldexpl functions return x * 2^exp.

◆ lgamma()

double lgamma ( double  x)

Compute gamma function.

The lgamma functions compute the natural logarithm of the absolute value of gamma of x. A range error occurs if x is too large. A pole error may occur if x is a negative integer or zero.

Parameters
xParameter for the log-gamma function.
Returns
The lgamma functions return log_e | Γ(x) |.

◆ lgammaf()

float lgammaf ( float  x)

Compute gamma function.

The lgammaf functions compute the natural logarithm of the absolute value of gamma of x. A range error occurs if x is too large. A pole error may occur if x is a negative integer or zero.

Parameters
xParameter for the log-gamma function.
Returns
The lgammaf functions return log_e | Γ(x) |.

◆ lgammal()

long double lgammal ( long double  x)

Compute gamma function.

The lgammal functions compute the natural logarithm of the absolute value of gamma of x. A range error occurs if x is too large. A pole error may occur if x is a negative integer or zero.

Parameters
xParameter for the log-gamma function.
Returns
The lgammal functions return log_e | Γ(x) |.

◆ llrint()

long long int llrint ( double  x)

Round and cast to long long integer.

The llrint function round their argument to the nearest integer value, rounding according to the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The llrint function return the rounded integer value.

◆ llrintf()

long long int llrintf ( float  x)

Round and cast to long long integer.

The llrintf function round their argument to the nearest integer value, rounding according to the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The llrintf function return the rounded integer value.

◆ llrintl()

long long int llrintl ( long double  x)

Round and cast to long long integer.

The llrintl function round their argument to the nearest integer value, rounding according to the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The llrintl function return the rounded integer value.

◆ llround()

long long int llround ( double  x)

Round to nearest and cast to long long integer.

The lround and llround functions round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lround and llround functions return the rounded integer value.

◆ llroundf()

long long int llroundf ( float  x)

Round to nearest and cast to long long integer.

The lround and llround functions round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lround and llround functions return the rounded integer value.

◆ llroundl()

long long int llroundl ( long double  x)

Round to nearest and cast to long long integer.

The lround and llround functions round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lround and llround functions return the rounded integer value.

◆ log()

double log ( double  x)

Compute natural logarithm.

The log functions compute the base-e (natural) logarithm of x. A domain error occurs if the argument is negative. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The log functions return log_e x.

◆ log10()

double log10 ( double  x)

Compute 10 based logarithm.

The log10 functions compute the base-10 (common) logarithm of x. A domain error occurs if the argument is negative. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The log10 functions return log_10 x.

◆ log10f()

float log10f ( float  x)

Compute 10 based logarithm.

The log10f functions compute the base-10 (common) logarithm of x. A domain error occurs if the argument is negative. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The log10f functions return log_10 x.

◆ log10l()

long double log10l ( long double  x)

Compute 10 based logarithm.

The log10l functions compute the base-10 (common) logarithm of x. A domain error occurs if the argument is negative. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The log10l functions return log_10 x.

◆ log1p()

double log1p ( double  x)

Compute natural logarithm of value + 1.

The log1p functions compute the base-e (natural) logarithm of 1 plus the argument. A domain error occurs if the argument is less than −1. A pole error may occur if the argument equals −1.

Parameters
xValue whose logarithm is calculated.
Returns
The log1p functions return log_e(1 + x).

◆ log1pf()

float log1pf ( float  x)

Compute natural logarithm of value + 1.

The log1pf functions compute the base-e (natural) logarithm of 1 plus the argument. A domain error occurs if the argument is less than −1. A pole error may occur if the argument equals −1.

Parameters
xValue whose logarithm is calculated.
Returns
The log1pf functions return log_e(1 + x).

◆ log1pl()

long double log1pl ( long double  x)

Compute natural logarithm of value + 1.

The log1pl functions compute the base-e (natural) logarithm of 1 plus the argument. A domain error occurs if the argument is less than −1. A pole error may occur if the argument equals −1.

Parameters
xValue whose logarithm is calculated.
Returns
The log1pl functions return log_e(1 + x).

◆ log2()

double log2 ( double  x)

Compute 2 based logarithm.

The log2 functions compute the base-2 logarithm of x. A domain error occurs if the argument is less than zero. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The log2 functions return log_2 x.

◆ log2f()

float log2f ( float  x)

Compute 2 based logarithm.

The log2f functions compute the base-2 logarithm of x. A domain error occurs if the argument is less than zero. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The log2f functions return log_2 x.

◆ log2l()

long double log2l ( long double  x)

Compute 2 based logarithm.

The log2l functions compute the base-2 logarithm of x. A domain error occurs if the argument is less than zero. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The log2l functions return log_2 x.

◆ logb()

double logb ( double  x)

Compute logarithm using FLT_RADIX.

The logb functions extract the exponent of x, as a signed integer value in floating-point format. If x is subnormal it is treated as though it were normalized; thus, for positive finite x, 1 ≤ x × FLT_RADIX^(−log_b(x)) < FLT_RADIX. A domain error or pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The logb functions return the signed exponent of x.

◆ logbf()

float logbf ( float  x)

Compute logarithm using FLT_RADIX.

The logbf functions extract the exponent of x, as a signed integer value in floating-point format. If x is subnormal it is treated as though it were normalized; thus, for positive finite x, 1 ≤ x × FLT_RADIX^(−log_b(x)) < FLT_RADIX. A domain error or pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The logbf functions return the signed exponent of x.

◆ logbl()

long double logbl ( long double  x)

Compute logarithm using FLT_RADIX.

The logbl functions extract the exponent of x, as a signed integer value in floating-point format. If x is subnormal it is treated as though it were normalized; thus, for positive finite x, 1 ≤ x × FLT_RADIX^(−log_b(x)) < FLT_RADIX. A domain error or pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The logbl functions return the signed exponent of x.

◆ logf()

float logf ( float  x)

Compute natural logarithm.

The logf functions compute the base-e (natural) logarithm of x. A domain error occurs if the argument is negative. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The logf functions return log_e x.

◆ logl()

long double logl ( long double  x)

Compute natural logarithm.

The logl functions compute the base-e (natural) logarithm of x. A domain error occurs if the argument is negative. A pole error may occur if the argument is zero.

Parameters
xValue whose logarithm is calculated.
Returns
The logl functions return log_e x.

◆ lrint()

long int lrint ( double  x)

Round and cast to long integer.

The lrint function round their argument to the nearest integer value, rounding according to the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lrint function return the rounded integer value.

◆ lrintf()

long int lrintf ( float  x)

Round and cast to long integer.

The lrintf function round their argument to the nearest integer value, rounding according to the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lrintf function return the rounded integer value.

◆ lrintl()

long int lrintl ( long double  x)

Round and cast to long integer.

The lrintl function round their argument to the nearest integer value, rounding according to the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lrintl function return the rounded integer value.

◆ lround()

long int lround ( double  x)

Round to nearest and cast to long integer.

The lround and llround functions round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lround and llround functions return the rounded integer value.

◆ lroundf()

long int lroundf ( float  x)

Round to nearest and cast to long integer.

The lround and llround functions round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lround and llround functions return the rounded integer value.

◆ lroundl()

long int lroundl ( long double  x)

Round to nearest and cast to long integer.

The lroundl and llround functions round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur.

Parameters
xValue to round.
Returns
The lroundl and llround functions return the rounded integer value.

◆ modf()

double modf ( double  x,
double *  iptr 
)

Break into fractional and integral parts.

The modf functions break the argument value into integral and fractional parts, each of which has the same type and sign as the argument. They store the integral part (in floating-point format) in the object pointed to by iptr.

Parameters
xFloating point value to break into parts.
iptrPointer to an object (of the same type as x) where the integral part is stored with the same sign as x.
Returns
The modf functions return the signed fractional part of value.

◆ modff()

float modff ( float  x,
float *  iptr 
)

Break into fractional and integral parts.

The modff functions break the argument value into integral and fractional parts, each of which has the same type and sign as the argument. They store the integral part (in floating-point format) in the object pointed to by iptr.

Parameters
xFloating point value to break into parts.
iptrPointer to an object (of the same type as x) where the integral part is stored with the same sign as x.
Returns
The modff functions return the signed fractional part of value.

◆ modfl()

long double modfl ( long double  x,
long double *  iptr 
)

Break into fractional and integral parts.

The modfl functions break the argument value into integral and fractional parts, each of which has the same type and sign as the argument. They store the integral part (in floating-point format) in the object pointed to by iptr.

Parameters
xFloating point value to break into parts.
iptrPointer to an object (of the same type as x) where the integral part is stored with the same sign as x.
Returns
The modfl functions return the signed fractional part of value.

◆ nan()

double nan ( const char *  arg)

Generate quiet NaN.

The call nan("n-char-sequence") is equivalent to strtod("NAN(n-charsequence)", (char**) NULL); the call nan("") is equivalent to strtod("NAN()", (char**) NULL). If tagp does not point to an n-char sequence or an empty string, the call is equivalent to strtod("NAN", (char**) NULL). Calls to nanf and nanl are equivalent to the corresponding calls to strtof and strtold.

Parameters
argNarrow character string identifying the contents of a NaN.
Returns
The nan functions return a quiet NaN, if available, with content indicated through tagp. If the implementation does not support quiet NaNs, the functions return zero.

◆ nanf()

float nanf ( const char *  arg)

Generate quiet NaN.

The call nan("n-char-sequence") is equivalent to strtod("NAN(n-charsequence)", (char**) NULL); the call nan("") is equivalent to strtod("NAN()", (char**) NULL). If tagp does not point to an n-char sequence or an empty string, the call is equivalent to strtod("NAN", (char**) NULL). Calls to nanf and nanl are equivalent to the corresponding calls to strtof and strtold.

Parameters
argNarrow character string identifying the contents of a NaN.
Returns
The nanf functions return a quiet NaN, if available, with content indicated through tagp. If the implementation does not support quiet NaNs, the functions return zero.

◆ nanl()

long double nanl ( const char *  arg)

Generate quiet NaN.

The call nan("n-char-sequence") is equivalent to strtod("NAN(n-charsequence)", (char**) NULL); the call nan("") is equivalent to strtod("NAN()", (char**) NULL). If tagp does not point to an n-char sequence or an empty string, the call is equivalent to strtod("NAN", (char**) NULL). Calls to nanf and nanl are equivalent to the corresponding calls to strtof and strtold.

Parameters
argNarrow character string identifying the contents of a NaN.
Returns
The nanl functions return a quiet NaN, if available, with content indicated through tagp. If the implementation does not support quiet NaNs, the functions return zero.

◆ nearbyint()

double nearbyint ( double  x)

Round to nearby integral value.

The nearbyint functions round their argument to an integer value in floating-point format, using the current rounding direction and without raising the ‘‘inexact’’ floatingpoint exception.

Parameters
xValue to round.
Returns
The nearbyint functions return the rounded integer value.

◆ nearbyintf()

float nearbyintf ( float  x)

Round to nearby integral value.

The nearbyintf functions round their argument to an integer value in floating-point format, using the current rounding direction and without raising the ‘‘inexact’’ floatingpoint exception.

Parameters
xValue to round.
Returns
The nearbyintf functions return the rounded integer value.

◆ nearbyintl()

long double nearbyintl ( long double  x)

Round to nearby integral value.

The nearbyintl functions round their argument to an integer value in floating-point format, using the current rounding direction and without raising the ‘‘inexact’’ floatingpoint exception.

Parameters
xValue to round.
Returns
The nearbyintl functions return the rounded integer value.

◆ nextafter()

double nextafter ( double  x,
double  y 
)

Next representable value.

The nextafter functions determine the next representable value, in the type of the function, after x in the direction of y, where x and y are first converted to the type of the function. The nextafter functions return y if x equals y. A range error may occur if the magnitude of x is the largest finite value representable in the type and the result is infinite or not representable in the type.

Parameters
xBase value.
yValue toward which the return value is approximated.
Returns
The nextafter functions return the next representable value in the specified format after x in the direction of y.

◆ nextafterf()

float nextafterf ( float  x,
float  y 
)

Next representable value.

The nextafterf functions determine the next representable value, in the type of the function, after x in the direction of y, where x and y are first converted to the type of the function. The nextafterf functions return y if x equals y. A range error may occur if the magnitude of x is the largest finite value representable in the type and the result is infinite or not representable in the type.

Parameters
xBase value.
yValue toward which the return value is approximated.
Returns
The nextafterf functions return the next representable value in the specified format after x in the direction of y.

◆ nextafterl()

long double nextafterl ( long double  x,
long double  y 
)

Next representable value.

The nextafterl functions determine the next representable value, in the type of the function, after x in the direction of y, where x and y are first converted to the type of the function. The nextafterl functions return y if x equals y. A range error may occur if the magnitude of x is the largest finite value representable in the type and the result is infinite or not representable in the type.

Parameters
xBase value.
yValue toward which the return value is approximated.
Returns
The nextafterl functions return the next representable value in the specified format after x in the direction of y.

◆ nexttoward()

double nexttoward ( double  x,
long double  y 
)

Next representable value toward precise value.

The nexttoward functions are equivalent to the nextafter functions except that the second parameter has type long double and the functions return y converted to the type of the function if x equals y.

Parameters
xBase value.
yValue toward which the return value is approximated.
Returns
The next representable value after x in the direction of y.

◆ nexttowardf()

float nexttowardf ( float  x,
long double  y 
)

Next representable value toward precise value.

The nexttowardf functions are equivalent to the nextafter functions except that the second parameter has type long double and the functions return y converted to the type of the function if x equals y.

Parameters
xBase value.
yValue toward which the return value is approximated.
Returns
The next representable value after x in the direction of y.

◆ nexttowardl()

long double nexttowardl ( long double  x,
long double  y 
)

Next representable value toward precise value.

The nexttowardl functions are equivalent to the nextafter functions except that the second parameter has type long double and the functions return y converted to the type of the function if x equals y.

Parameters
xBase value.
yValue toward which the return value is approximated.
Returns
The next representable value after x in the direction of y.

◆ pow()

double pow ( double  base,
double  exponent 
)

Compute power.

The pow functions compute x raised to the power y. A domain error occurs if x is finite and negative and y is finite and not an integer value. A range error may occur. A domain error may occur if x is zero and y is zero. A domain error or pole error may occur if x is zero and y is less than zero.

Parameters
baseBase of power.
exponentExponent of power.
Returns
The pow functions return x^y.

◆ powf()

float powf ( float  base,
float  exponent 
)

Compute power.

The powf functions compute x raised to the power y. A domain error occurs if x is finite and negative and y is finite and not an integer value. A range error may occur. A domain error may occur if x is zero and y is zero. A domain error or pole error may occur if x is zero and y is less than zero.

Parameters
baseBase of power.
exponentExponent of power.
Returns
The powf functions return x^y.

◆ powl()

long double powl ( long double  base,
long double  exponent 
)

Compute power.

The powl functions compute x raised to the power y. A domain error occurs if x is finite and negative and y is finite and not an integer value. A range error may occur. A domain error may occur if x is zero and y is zero. A domain error or pole error may occur if x is zero and y is less than zero.

Parameters
baseBase of power.
exponentExponent of power.
Returns
The powl functions return x^y.

◆ remainder()

double remainder ( double  x,
double  y 
)

Compute reminder required by IEC 60559.

The remainder functions compute the remainder x REM y required by IEC 60559.

Parameters
xValue of the quotient numerator..
yValue of the quotient denominator..
Returns
The remainder functions return x REM y. If y is zero, whether a domain error occurs or the functions return zero is implementation defined.

◆ remainderf()

float remainderf ( float  x,
float  y 
)

Compute reminder required by IEC 60559.

The remainderf functions compute the remainder x REM y required by IEC 60559.

Parameters
xValue of the quotient numerator..
yValue of the quotient denominator..
Returns
The remainder functions return x REM y. If y is zero, whether a domain error occurs or the functions return zero is implementation defined.

◆ remainderl()

long double remainderl ( long double  x,
long double  y 
)

Compute reminder required by IEC 60559.

The remainderl functions compute the remainder x REM y required by IEC 60559.

Parameters
xValue of the quotient numerator..
yValue of the quotient denominator..
Returns
The remainderl functions return x REM y. If y is zero, whether a domain error occurs or the functions return zero is implementation defined.

◆ remquo()

double remquo ( double  numer,
double  denom,
int *  quot 
)

Compute remainder and quotient.

The remquo functions compute the same remainder as the remainder functions. In the object pointed to by quo they store a value whose sign is the sign of x/y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where n is an implementation-defined integer greater than or equal to 3.

Parameters
numerFloating point value with the quotient numerator.
denomFloating point value with the quotient denominator.
quotPointer to an object where the quotient internally used to determine the remainder is stored as a value of type int.
Returns
The remquo functions return x REM y. If y is zero, the value stored in the object pointed to by quo is unspecified and whether a domain error occurs or the functions return zero is implementation defined.

◆ remquof()

float remquof ( float  numer,
float  denom,
int *  quot 
)

Compute remainder and quotient.

The remquof functions compute the same remainder as the remainder functions. In the object pointed to by quo they store a value whose sign is the sign of x/y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where n is an implementation-defined integer greater than or equal to 3.

Parameters
numerFloating point value with the quotient numerator.
denomFloating point value with the quotient denominator.
quotPointer to an object where the quotient internally used to determine the remainder is stored as a value of type int.
Returns
The remquof functions return x REM y. If y is zero, the value stored in the object pointed to by quo is unspecified and whether a domain error occurs or the functions return zero is implementation defined.

◆ remquol()

long double remquol ( long double  numer,
long double  denom,
int *  quot 
)

Compute remainder and quotient.

The remquol functions compute the same remainder as the remainder functions. In the object pointed to by quo they store a value whose sign is the sign of x/y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where n is an implementation-defined integer greater than or equal to 3.

Parameters
numerFloating point value with the quotient numerator.
denomFloating point value with the quotient denominator.
quotPointer to an object where the quotient internally used to determine the remainder is stored as a value of type int.
Returns
The remquol functions return x REM y. If y is zero, the value stored in the object pointed to by quo is unspecified and whether a domain error occurs or the functions return zero is implementation defined.

◆ rint()

double rint ( double  x)

Round to integral value.

The rint functions round their argument to an integer value in floating-point format, using the current rounding direction.

Parameters
xValue to round.
Returns
The rint functions return the rounded integer value.

◆ rintf()

float rintf ( float  x)

Round to integral value.

The rintf functions round their argument to an integer value in floating-point format, using the current rounding direction.

Parameters
xValue to round.
Returns
The rintf functions return the rounded integer value.

◆ rintl()

long double rintl ( long double  x)

Round to integral value.

The rintl functions round their argument to an integer value in floating-point format, using the current rounding direction.

Parameters
xValue to round.
Returns
The rintl functions return the rounded integer value.

◆ round()

double round ( double  x)

Round to nearest.

The round functions round their argument to the nearest integer value in floating-point format, rounding halfway cases away from zero, regardless of the current rounding direction.

Parameters
xValue to round.
Returns
The round functions return the rounded integer value.

◆ roundf()

float roundf ( float  x)

Round to nearest.

The roundf functions round their argument to the nearest integer value in floating-point format, rounding halfway cases away from zero, regardless of the current rounding direction.

Parameters
xValue to round.
Returns
The roundf functions return the rounded integer value.

◆ roundl()

long double roundl ( long double  x)

Round to nearest.

The roundl functions round their argument to the nearest integer value in floating-point format, rounding halfway cases away from zero, regardless of the current rounding direction.

Parameters
xValue to round.
Returns
The roundl functions return the rounded integer value.

◆ scalbln()

double scalbln ( double  x,
long int  n 
)

Scale significand using floating-point base exponent.

The scalbln function compute x × FLT_RADIX^n efficiently, not normally by computing FLT_RADIX^n explicitly. A range error may occur.

Parameters
xValue representing the significand.
nValue of the exponent.
Returns
The scalbln function return x × FLT_RADIX^n.

◆ scalblnf()

float scalblnf ( float  x,
long int  n 
)

Scale significand using floating-point base exponent.

The scalblnf function compute x × FLT_RADIX^n efficiently, not normally by computing FLT_RADIX^n explicitly. A range error may occur.

Parameters
xValue representing the significand.
nValue of the exponent.
Returns
The scalblnf function return x × FLT_RADIX^n.

◆ scalblnl()

long double scalblnl ( long double  x,
long int  n 
)

Scale significand using floating-point base exponent.

The scalblnl function compute x × FLT_RADIX^n efficiently, not normally by computing FLT_RADIX^n explicitly. A range error may occur.

Parameters
xValue representing the significand.
nValue of the exponent.
Returns
The scalblnl function return x × FLT_RADIX^n.

◆ scalbn()

double scalbn ( double  x,
int  n 
)

Scale significand using floating-point base exponent.

The scalbn function compute x × FLT_RADIX^n efficiently, not normally by computing FLT_RADIX^n explicitly. A range error may occur.

Parameters
xValue representing the significand.
nValue of the exponent.
Returns
The scalbn function return x × FLT_RADIX^n.

◆ scalbnf()

float scalbnf ( float  x,
int  n 
)

Scale significand using floating-point base exponent.

The scalbnf function compute x × FLT_RADIX^n efficiently, not normally by computing FLT_RADIX^n explicitly. A range error may occur.

Parameters
xValue representing the significand.
nValue of the exponent.
Returns
The scalbnf function return x × FLT_RADIX^n.

◆ scalbnl()

long double scalbnl ( long double  x,
int  n 
)

Scale significand using floating-point base exponent.

The scalbnl function compute x × FLT_RADIX^n efficiently, not normally by computing FLT_RADIX^n explicitly. A range error may occur.

Parameters
xValue representing the significand.
nValue of the exponent.
Returns
The scalbnl function return x × FLT_RADIX^n.

◆ sin()

double sin ( double  x)

Compute cosine.

The sin functions compute the sine of x (measured in radians).

Parameters
xValue representing an angle expressed in radians.
Returns
Sine of x radians.

◆ sinf()

float sinf ( float  x)

Compute cosine.

The sinf functions compute the sine of x (measured in radians).

Parameters
xValue representing an angle expressed in radians.
Returns
Sine of x radians.

◆ sinh()

double sinh ( double  x)

Compute hyperbolic sine.

The sinh functions compute the hyperbolic sine of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue representing a hyperbolic angle.
Returns
The sinh functions return sinh x.

◆ sinhf()

float sinhf ( float  x)

Compute hyperbolic sine.

The sinhf functions compute the hyperbolic sine of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue representing a hyperbolic angle.
Returns
The sinhf functions return sinh x.

◆ sinhl()

long double sinhl ( long double  x)

Compute hyperbolic sine.

The sinhl functions compute the hyperbolic sine of x. A range error occurs if the magnitude of x is too large.

Parameters
xValue representing a hyperbolic angle.
Returns
The sinhl functions return sinh x.

◆ sinl()

long double sinl ( long double  x)

Compute cosine.

The sinl functions compute the sine of x (measured in radians).

Parameters
xValue representing an angle expressed in radians.
Returns
Sine of x radians.

◆ sqrt()

double sqrt ( double  x)

Compute square root.

The sqrt functions compute the nonnegative square root of x. A domain error occurs if the argument is less than zero.

Parameters
xValue whose square root is computed.
Returns
The sqrt functions return √x.

◆ sqrtf()

float sqrtf ( float  x)

Compute square root.

The sqrtf functions compute the nonnegative square root of x. A domain error occurs if the argument is less than zero.

Parameters
xValue whose square root is computed.
Returns
The sqrtf functions return √x.

◆ sqrtl()

long double sqrtl ( long double  x)

Compute square root.

The sqrtl functions compute the nonnegative square root of x. A domain error occurs if the argument is less than zero.

Parameters
xValue whose square root is computed.
Returns
The sqrtl functions return √x.

◆ tan()

double tan ( double  x)

Compute tangent.

The tan functions compute the tangent of x (measured in radians).

Parameters
xValue representing an angle, expressed in radians.
Returns
Tangent of x radians.

◆ tanf()

float tanf ( float  x)

Compute tangent.

The tanf functions compute the tangent of x (measured in radians).

Parameters
xValue representing an angle, expressed in radians.
Returns
Tangent of x radians.

◆ tanh()

double tanh ( double  x)

Compute hyperbolic tangent.

The tanh functions compute the hyperbolic tangent of x.

Parameters
xValue representing a hyperbolic angle.
Returns
The tanh functions return tanh x.

◆ tanhf()

float tanhf ( float  x)

Compute hyperbolic tangent.

The tanhf functions compute the hyperbolic tangent of x.

Parameters
xValue representing a hyperbolic angle.
Returns
The tanhf functions return tanh x.

◆ tanhl()

long double tanhl ( long double  x)

Compute hyperbolic tangent.

The tanhl functions compute the hyperbolic tangent of x.

Parameters
xValue representing a hyperbolic angle.
Returns
The tanhl functions return tanh x.

◆ tanl()

long double tanl ( long double  x)

Compute tangent.

The tanl functions compute the tangent of x (measured in radians).

Parameters
xValue representing an angle, expressed in radians.
Returns
Tangent of x radians.

◆ tgamma()

double tgamma ( double  x)

Compute gamma function.

The tgamma functions compute the gamma function of x. A domain error or pole error may occur if x is a negative integer or zero. A range error occurs if the magnitude of x is too large and may occur if the magnitude of x is too small.

Parameters
xParameter for the gamma function.
Returns
The tgamma functions return Γ(x).

◆ tgammaf()

float tgammaf ( float  x)

Compute gamma function.

The tgammaf functions compute the gamma function of x. A domain error or pole error may occur if x is a negative integer or zero. A range error occurs if the magnitude of x is too large and may occur if the magnitude of x is too small.

Parameters
xParameter for the gamma function.
Returns
The tgamma functions return Γ(x).

◆ tgammal()

long double tgammal ( long double  x)

Compute gamma function.

The tgammal functions compute the gamma function of x. A domain error or pole error may occur if x is a negative integer or zero. A range error occurs if the magnitude of x is too large and may occur if the magnitude of x is too small.

Parameters
xParameter for the gamma function.
Returns
The tgamma functions return Γ(x).

◆ trunc()

double trunc ( double  x)

Truncate value.

The trunc functions round their argument to the integer value, in floating format, nearest to but no larger in magnitude than the argument.

Parameters
xValue to truncate.
Returns
The trunc functions return the truncated integer value.

◆ truncf()

float truncf ( float  x)

Truncate value.

The truncf functions round their argument to the integer value, in floating format, nearest to but no larger in magnitude than the argument.

Parameters
xValue to truncate.
Returns
The truncf functions return the truncated integer value.

◆ truncl()

long double truncl ( long double  x)

Truncate value.

The truncl functions round their argument to the integer value, in floating format, nearest to but no larger in magnitude than the argument.

Parameters
xValue to truncate.
Returns
The truncl functions return the truncated integer value.

Variable Documentation

◆ _math_errhandling

int _math_errhandling

Expands to an expression of type int that is either equal to MATH_ERRNO, or equal to MATH_ERREXCEPT, or equal to their bitwise OR (MATH_ERRNO | MATH_ERREXCEPT).