Documentation
Tools for embedded systems
|
Fast floating-point math library for applications where speed is more important than accuracy. More...
Functions | |
int | qFFMath_FPClassify (const float f) |
Categorizes the floating-point number x. This function determines whether its argument is a normal floating-point number, or one of several special categories of values, including NaN (not a number), infinity, subnormal floating-point values or zero. To determine what category the argument belongs to, compare the return value with the any of the following number classification macros: | |
bool | qFFMath_IsNaN (const float x) |
Determine if x is Not-A-Number (NaN) aka QFFM_NAN. | |
bool | qFFMath_IsInf (const float x) |
Determine if x is Infinity. | |
bool | qFFMath_IsFinite (const float x) |
Determines if the given floating point number x has finite value i.e. it is normal, subnormal or zero, but not infinite or NaN. | |
bool | qFFMath_IsNormal (const float x) |
Determines if the given floating point number x is normal, i.e. is neither zero, subnormal, infinite, or NaN. | |
float | qFFMath_Abs (float x) |
Computes the absolute value of a floating point value x. | |
float | qFFMath_Recip (float x) |
Computes the multiplicative inverse or reciprocal for the value x, denoted by 1/x or x^(−1) | |
float | qFFMath_Sqrt (float x) |
Computes the square-root of x. | |
float | qFFMath_RSqrt (float x) |
Computes the reciprocal square-root of x denoted as 1/sqrt(x) | |
float | qFFMath_Cbrt (float x) |
Computes the cubic-root of x. | |
float | qFFMath_RCbrt (float x) |
Computes the reciprocal cubic-root of x denoted as 1/cbrt(x) | |
float | qFFMath_Round (float x) |
Computes the nearest integer value to x (in floating-point format), rounding halfway cases away from zero. | |
float | qFFMath_Floor (float x) |
Computes the largest integer value not greater than x. | |
float | qFFMath_Ceil (float x) |
Computes the smallest integer value not less than x. | |
float | qFFMath_Trunc (float x) |
Computes the nearest integer not greater in magnitude than x. | |
float | qFFMath_Frac (float x) |
Obtain the fractional part of x. | |
float | qFFMath_Remainder (float x, float y) |
Computes the IEEE remainder of the floating point division operation x/y . | |
float | qFFMath_Mod (float x, float y) |
Computes the floating-point remainder of the division operation x/y . | |
float | qFFMath_Sin (float x) |
Computes the sine of x (measured in radians). | |
float | qFFMath_Cos (float x) |
Computes the cosine of x (measured in radians). | |
float | qFFMath_Tan (float x) |
Computes the tangent of x (measured in radians). | |
float | qFFMath_ASin (float x) |
Computes the principal value of the arc sine of x. | |
float | qFFMath_ACos (float x) |
Computes the principal value of the arc cosine of x. | |
float | qFFMath_ATan (float x) |
Computes the principal value of the arc tangent of x. | |
float | qFFMath_ATan2 (float y, float x) |
Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant. | |
float | qFFMath_Exp2 (float x) |
Computes 2 raised to the given power x. | |
float | qFFMath_Log2 (float x) |
Computes the base 2 logarithm of x. | |
float | qFFMath_Exp (float x) |
Computes the e (Euler's number, 2.7182818) raised to the given power x. | |
float | qFFMath_Exp10 (float x) |
Computes the value of 10 raised to the power of x. | |
float | qFFMath_Log (float x) |
Computes the natural (base e) logarithm of x. | |
float | qFFMath_Log10 (float x) |
Computes the common (base-10) logarithm of x. | |
float | qFFMath_Pow (float b, float e) |
Computes the value of b raised to the power e. | |
float | qFFMath_Sinh (float x) |
Computes hyperbolic sine of x. | |
float | qFFMath_Cosh (float x) |
Computes hyperbolic cosine of x. | |
float | qFFMath_Tanh (float x) |
Computes hyperbolic tangent of x. | |
float | qFFMath_ASinh (float x) |
Computes the inverse hyperbolic sine of x. | |
float | qFFMath_ACosh (float x) |
Computes the inverse hyperbolic cosine of x. | |
float | qFFMath_ATanh (float x) |
Computes the inverse hyperbolic tangent of x. | |
float | qFFMath_WrapToPi (float x) |
Wraps angle x, in radians, to the interval [−pi, pi] such that pi maps to pi and -pi maps to -pi . In general, odd, positive multiples of pi map to pi and odd, negative multiples of pi map to -pi . | |
float | qFFMath_WrapTo2Pi (float x) |
Wraps angle x, in radians, to the interval [0, 2*pi] such that 0 maps to 0 and 2*pi and 2*pi maps to 2*pi . In general, positive multiples of 2*pi map to 2*pi and negative multiples of 2*pi map to 0 . | |
float | qFFMath_WrapTo180 (float x) |
Wraps angle x, in degrees, to the interval [–180, 180] such that 180 maps to 180 and -180 maps to -180 . In general, odd, positive multiples of 180 map to 180 and odd, negative multiples of 180 map to -180 . | |
float | qFFMath_WrapTo360 (float x) |
Wraps angle x, in degrees, to the interval [0, 360] such that 0 maps to 0 and 360 maps to 360 . In general, positive multiples of 360 map to 360 and negative multiples of 360 map to zero. | |
float | qFFMath_Erf (float x) |
Computes the error function of x. | |
float | qFFMath_Erfc (float x) |
Computes the complementary error function of x. | |
float | qFFMath_Max (float x, float y) |
Returns the larger of two floating point arguments. | |
float | qFFMath_Min (float x, float y) |
Returns the smaller of two floating point arguments. | |
float | qFFMath_RExp (float x, int32_t *pw2) |
Decomposes given floating point value x into a normalized fraction and an integral power of two. | |
float | qFFMath_LDExp (float x, int32_t pw2) |
Multiplies a floating point value x by the number 2 raised to the pw2 power. | |
float | qFFMath_Hypot (float x, float y) |
Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation. | |
float | qFFMath_NextAfter (float x, float y) |
Returns the next representable value of x in the direction of y. If x equals to y, y is returned. | |
float | qFFMath_Midpoint (float a, float b) |
Computes the midpoint of the floating-points a and b. | |
float | qFFMath_Lerp (float a, float b, float t) |
Computes the linear interpolation between a and b, if the parameter t is inside [0, 1] (the linear extrapolation otherwise), i.e. the result of a+t*(b-a) with accounting for floating-point calculation imprecision. | |
float | qFFMath_Normalize (const float x, const float xMin, const float xMax) |
Normalize the given input x in value range given by xMin and xMax to value range between 0 and 1. | |
float | qFFMath_Map (const float x, const float xMin, const float xMax, const float yMin, const float yMax) |
Scales the given input x in value range given by xMin and xMax to value range specified by the yMin and yMax. | |
bool | qFFMath_InRangeCoerce (float *const x, const float lowerL, const float upperL) |
Determines if the value pointed by x falls within a range specified by the upper limit and lower limit inputs and coerces the value to fall within the range. | |
bool | qFFMath_InPolygon (const float x, const float y, const float *const px, const float *const py, const size_t p) |
Determines if the point at ( x, y ) is inside the polygon given by the set of points on px and py. | |
bool | qFFMath_InCircle (const float x, const float y, const float cx, const float cy, const float r) |
Determines if the point at ( x, y) is inside the circle with radius r located at cx and cy. | |
float | qFFMath_TGamma (float x) |
Computes the gamma function of x. | |
float | qFFMath_LGamma (float x) |
Computes the natural logarithm of the absolute value of the gamma function of x. | |
float | qFFMath_Factorial (float x) |
Return the factorial of the integer part of x. | |
float | qFFMath_Assoc_laguerre (size_t n, size_t m, float x) |
Computes the associated Laguerre polynomials of the degree n, order m, and argument x. | |
float | qFFMath_Assoc_legendre (size_t n, size_t m, float x) |
Computes the associated Legendre polynomials of the degree n, order m, and argument x. | |
float | qFFMath_Beta (float x, float y) |
Computes the Beta function of x and y. | |
float | qFFMath_Comp_ellint_1 (float k) |
Computes the complete elliptic integral of the first kind of k. | |
float | qFFMath_Comp_ellint_2 (float k) |
Computes the complete elliptic integral of the second kind of k. | |
float | qFFMath_Comp_ellint_3 (float k, float nu) |
Computes the complete elliptic integral of the third kind of k and nu. | |
float | qFFMath_Ellint_1 (float k, float phi) |
Computes the incomplete elliptic integral of the first kind of k and phi. | |
float | qFFMath_Ellint_2 (float k, float phi) |
Computes the incomplete elliptic integral of the second kind of k and phi. | |
float | qFFMath_Ellint_3 (float k, float nu, float phi) |
Computes the incomplete elliptic integral of the third kind of k, nu and phi. | |
float | qFFMath_Expint (float num) |
Computes the Exponential integral of num. | |
float | qFFMath_Hermite (size_t n, float x) |
Computes the (physicist's) Hermite polynomials of the degree n and argument x. | |
float | qFFMath_Laguerre (size_t n, float x) |
Computes the non-associated Laguerre polynomials of the degree n, and argument x. | |
float | qFFMath_Legendre (size_t n, float x) |
Computes the unassociated Legendre polynomials of the degree n, and argument x. | |
float | qFFMath_Riemann_zeta (float s) |
Computes the Riemann zeta function of s. | |
float | qFFMath_Sph_bessel (size_t n, float x) |
Computes the spherical Bessel function of the first kind n, and x. | |
float | qFFMath_Sph_neumann (size_t n, float x) |
Computes the spherical Bessel function of the second kind also known as the spherical Neumann function of n and x. | |
float | qFFMath_Cyl_bessel_i (float nu, float x) |
Computes the regular modified cylindrical Bessel function of nu and x. | |
float | qFFMath_Cyl_bessel_j (float nu, float x) |
Computes the cylindrical Bessel function of the first kind of nu and x. | |
float | qFFMath_Cyl_bessel_k (float nu, float x) |
Computes the irregular modified cylindrical Bessel function (also known as modified Bessel function of the second kind) of nu and x. | |
float | qFFMath_Cyl_neumann (float nu, float x) |
Computes the cylindrical Neumann function ( also known as Bessel function of the second kind or Weber function) of nu and x. | |
float | qFFMath_Sph_legendre (size_t l, size_t m, float theta) |
1-3) Computes the spherical associated Legendre function of degree l, order m, and polar angle theta | |
Fast floating-point math library for applications where speed is more important than accuracy.
float qFFMath_Abs | ( | float | x | ) |
Computes the absolute value of a floating point value x.
[in] | x | The floating point value |
float qFFMath_ACos | ( | float | x | ) |
Computes the principal value of the arc cosine of x.
[in] | x | The floating point value |
arccos(x)
in the range [0 ; pi]. is returned.If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_ACosh | ( | float | x | ) |
Computes the inverse hyperbolic cosine of x.
[in] | x | The floating point value |
cosh^-1(x)
is returned. float qFFMath_ASin | ( | float | x | ) |
Computes the principal value of the arc sine of x.
[in] | x | The floating point value |
arcsin(x)
in the range [-pi/2 ; pi/2]. is returned.If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_ASinh | ( | float | x | ) |
Computes the inverse hyperbolic sine of x.
[in] | x | The floating point value |
sinh^-1(x)
is returned. float qFFMath_Assoc_laguerre | ( | size_t | n, |
size_t | m, | ||
float | x ) |
Computes the associated Laguerre polynomials of the degree n, order m, and argument x.
[in] | n | The degree of the polynomial, an unsigned integer value |
[in] | m | The order of the polynomial, an unsigned integer value |
[in] | x | The argument, a floating-point or integer value |
nan
, a nan
is returned. If x is negative, nan
is returned. If n or m is greater or equal to 128
, the behavior is implementation-defined. float qFFMath_Assoc_legendre | ( | size_t | n, |
size_t | m, | ||
float | x ) |
Computes the associated Legendre polynomials of the degree n, order m, and argument x.
[in] | n | The degree of the polynomial, an unsigned integer value |
[in] | m | The order of the polynomial, an unsigned integer value |
[in] | x | The argument, a floating-point or integer value |
nan
, a nan
is returned. If |x| > 1
, nan
is returned due the domain error. If n is greater or equal to 128
, the behavior is implementation-defined. float qFFMath_ATan | ( | float | x | ) |
Computes the principal value of the arc tangent of x.
[in] | x | The floating point value |
arctan(x)
in the range [-pi/2 ; pi/2]. is returned.If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_ATan2 | ( | float | y, |
float | x ) |
Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant.
[in] | y | The floating point value |
[in] | x | The floating point value |
y/x
arctan(y/x)
in the range [-pi ; +pi] radians, is returned. If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_ATanh | ( | float | x | ) |
Computes the inverse hyperbolic tangent of x.
[in] | x | The floating point value |
tanh^-1(x)
is returned. If a domain error occurs, a QFFM_NAN value is returned. If a pole error occurs, ± QFFM_INFINITY is returned. float qFFMath_Beta | ( | float | x, |
float | y ) |
Computes the Beta function of x and y.
[in] | x | The argument, a floating-point or integer value |
[in] | y | The argument, a floating-point or integer value |
nan
, nan
is returned. The function is only required to be defined where both x and y are greater than zero, and is allowed to return nan
otherwise. float qFFMath_Cbrt | ( | float | x | ) |
Computes the cubic-root of x.
[in] | x | The floating point value |
float qFFMath_Ceil | ( | float | x | ) |
Computes the smallest integer value not less than x.
[in] | x | The floating point value |
float qFFMath_Comp_ellint_1 | ( | float | k | ) |
Computes the complete elliptic integral of the first kind of k.
[in] | k | Elliptic modulus or eccentricity as a floating-point value |
nan
, nan
is returned. If |k| > 1
, NaN is returned due the domain error float qFFMath_Comp_ellint_2 | ( | float | k | ) |
Computes the complete elliptic integral of the second kind of k.
[in] | k | Elliptic modulus or eccentricity as a floating-point value |
nan
, nan
is returned. If |k| > 1
, nan
is returned due the domain error float qFFMath_Comp_ellint_3 | ( | float | k, |
float | nu ) |
Computes the complete elliptic integral of the third kind of k and nu.
[in] | k | Elliptic modulus or eccentricity as a floating-point value |
[in] | nu | Elliptic characteristic as a floating-point value |
nan
, nan
is returned. If |k| > 1
, nan
is returned due the domain error float qFFMath_Cos | ( | float | x | ) |
Computes the cosine of x (measured in radians).
[in] | x | The floating point value |
cos(x)
in the range [-1 ; +1], is returned. If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_Cosh | ( | float | x | ) |
Computes hyperbolic cosine of x.
[in] | x | The floating point value |
cosh(x)
is returned. If a range error occurs, a QFFM_INFINITY value is returned. float qFFMath_Cyl_bessel_i | ( | float | nu, |
float | x ) |
Computes the regular modified cylindrical Bessel function of nu and x.
[in] | nu | The order of the function |
[in] | x | The argument to the function, a floating-point or integer value |
nan
, a nan
is returned. If nu is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Cyl_bessel_j | ( | float | nu, |
float | x ) |
Computes the cylindrical Bessel function of the first kind of nu and x.
[in] | nu | The order of the function |
[in] | x | The argument to the function, a floating-point or integer value |
nan
, a nan
is returned. If nu is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Cyl_bessel_k | ( | float | nu, |
float | x ) |
Computes the irregular modified cylindrical Bessel function (also known as modified Bessel function of the second kind) of nu and x.
[in] | nu | The order of the function |
[in] | x | The argument to the function, a floating-point or integer value |
nan
, a nan
is returned. If nu is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Cyl_neumann | ( | float | nu, |
float | x ) |
Computes the cylindrical Neumann function ( also known as Bessel function of the second kind or Weber function) of nu and x.
[in] | nu | The order of the function |
[in] | x | The argument to the function, a floating-point or integer value |
nan
, a nan
is returned. If nu is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Ellint_1 | ( | float | k, |
float | phi ) |
Computes the incomplete elliptic integral of the first kind of k and phi.
[in] | k | Elliptic modulus or eccentricity as a floating-point value |
[in] | phi | Jacobi amplitude as a floating-point value given in radians |
nan
, nan
is returned. If |k| > 1
, nan
is returned due the domain error float qFFMath_Ellint_2 | ( | float | k, |
float | phi ) |
Computes the incomplete elliptic integral of the second kind of k and phi.
[in] | k | Elliptic modulus or eccentricity as a floating-point value |
[in] | phi | Jacobi amplitude as a floating-point value given in radians |
nan
, nan
is returned. If |k| > 1
, nan
is returned due the domain error float qFFMath_Ellint_3 | ( | float | k, |
float | nu, | ||
float | phi ) |
Computes the incomplete elliptic integral of the third kind of k, nu and phi.
[in] | k | Elliptic modulus or eccentricity as a floating-point value |
[in] | nu | Elliptic characteristic as a floating-point value |
[in] | phi | Jacobi amplitude as a floating-point value given in radians |
nan
, nan
is returned. If |k| > 1
, nan
is returned due the domain error float qFFMath_Erf | ( | float | x | ) |
Computes the error function of x.
[in] | x | The floating point value |
float qFFMath_Erfc | ( | float | x | ) |
Computes the complementary error function of x.
[in] | x | The floating point value |
float qFFMath_Exp | ( | float | x | ) |
Computes the e (Euler's number, 2.7182818) raised to the given power x.
[in] | x | The floating point value |
e^(x)
is returned. If a range error due to overflow occurs, +QFFM_INFINITY is returned. float qFFMath_Exp10 | ( | float | x | ) |
Computes the value of 10 raised to the power of x.
[in] | x | The floating point value |
10^(x)
is returned. If a range error due to overflow occurs, ± QFFM_INFINITY or NAN is returned. float qFFMath_Exp2 | ( | float | x | ) |
Computes 2 raised to the given power x.
[in] | x | The floating point value |
2^x
is returned. If a range error due to overflow occurs, QFFM_INFINITY is returned. float qFFMath_Expint | ( | float | num | ) |
Computes the Exponential integral of num.
[in] | num | A floating-point value |
nan
, nan
is returned. If the argument is ±0
, -inf
is returned. float qFFMath_Factorial | ( | float | x | ) |
Return the factorial of the integer part of x.
14
, result is imprecise because of the limited precision of the 32-bit floating point data-type. With x values greater than 35
, this function overflows. [in] | x | The floating point value |
nan
. If the correct value would cause overflow, qFFMath_Factorial() shall return +inf
. float qFFMath_Floor | ( | float | x | ) |
Computes the largest integer value not greater than x.
[in] | x | The floating point value |
int qFFMath_FPClassify | ( | const float | f | ) |
Categorizes the floating-point number x. This function determines whether its argument is a normal floating-point number, or one of several special categories of values, including NaN (not a number), infinity, subnormal floating-point values or zero. To determine what category the argument belongs to, compare the return value with the any of the following number classification macros:
[in] | f | The number you want to test. |
float qFFMath_Frac | ( | float | x | ) |
Obtain the fractional part of x.
[in] | x | The floating point value |
float qFFMath_Hermite | ( | size_t | n, |
float | x ) |
Computes the (physicist's) Hermite polynomials of the degree n and argument x.
[in] | n | The degree of the polynomial |
[in] | x | The argument, a floating-point value |
nan
, nan
is returned. If n>=128
, the behavior is implementation-defined. float qFFMath_Hypot | ( | float | x, |
float | y ) |
Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation.
[in] | x | The floating point value |
[in] | y | The floating point value |
sqrt(x^2 + y^2)
, is returned. If a range error due to overflow occurs, +QFFM_INFINITY is returned. If a range error due to underflow occurs, the correct result (after rounding) is returned. bool qFFMath_InCircle | ( | const float | x, |
const float | y, | ||
const float | cx, | ||
const float | cy, | ||
const float | r ) |
Determines if the point at ( x, y) is inside the circle with radius r located at cx and cy.
[in] | x | Point x-coordinate |
[in] | y | Point y-coordinate |
[in] | cx | X-location of the circle |
[in] | cy | Y-location of the circle |
[in] | r | Radio of the circle |
true
when the given point is inside the circle bool qFFMath_InPolygon | ( | const float | x, |
const float | y, | ||
const float *const | px, | ||
const float *const | py, | ||
const size_t | p ) |
Determines if the point at ( x, y ) is inside the polygon given by the set of points on px and py.
[in] | x | Point x-coordinate |
[in] | y | Point y-coordinate |
[in] | px | x-coordinate points of the polygon |
[in] | py | y-coordinate points of the polygon |
[in] | p | Number of points that represent the polygon |
true
when the given point is inside the polygon bool qFFMath_InRangeCoerce | ( | float *const | x, |
const float | lowerL, | ||
const float | upperL ) |
Determines if the value pointed by x falls within a range specified by the upper limit and lower limit inputs and coerces the value to fall within the range.
[in,out] | x | Input |
[in] | lowerL | Lower limit. |
[in] | upperL | Upper limit. |
true
when the value falls within the specified range, otherwise false bool qFFMath_IsFinite | ( | const float | x | ) |
Determines if the given floating point number x has finite value i.e. it is normal, subnormal or zero, but not infinite or NaN.
[in] | x | The number you want to test. |
bool qFFMath_IsInf | ( | const float | x | ) |
Determine if x is Infinity.
[in] | x | The number you want to test. |
bool qFFMath_IsNaN | ( | const float | x | ) |
bool qFFMath_IsNormal | ( | const float | x | ) |
Determines if the given floating point number x is normal, i.e. is neither zero, subnormal, infinite, or NaN.
[in] | x | The number you want to test. |
float qFFMath_Laguerre | ( | size_t | n, |
float | x ) |
Computes the non-associated Laguerre polynomials of the degree n, and argument x.
[in] | n | The degree of the polynomial, an unsigned integer value |
[in] | x | The argument, a floating-point or integer value |
nan
, a nan
is returned. If x is negative, nan
is returned. If n is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_LDExp | ( | float | x, |
int32_t | pw2 ) |
Multiplies a floating point value x by the number 2 raised to the pw2 power.
[in] | x | The floating point value |
[in] | pw2 | Integer value |
x×2^pwd
is returned. If a range error due to overflow occurs, ± QFFM_INFINITY is returned. If a range error due to underflow occurs, the correct result (after rounding) is returned. float qFFMath_Legendre | ( | size_t | n, |
float | x ) |
Computes the unassociated Legendre polynomials of the degree n, and argument x.
[in] | n | The degree of the polynomial, an unsigned integer value |
[in] | x | The argument, a floating-point or integer value |
nan
, a nan
is returned. The function is not required to be defined for |x| > 1
. If n is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Lerp | ( | float | a, |
float | b, | ||
float | t ) |
Computes the linear interpolation between a and b, if the parameter t is inside [0, 1] (the linear extrapolation otherwise), i.e. the result of a+t*(b-a)
with accounting for floating-point calculation imprecision.
a | A floating point value |
b | A floating point value |
t | A floating point value |
a+t*(b-a)
. When both a and b are finite, the following properties are guaranteed: If t==0
, the result is equal to a. If t==1
, the result is equal to b. If t>=0
and t<=1
, the result is finite. If t is finite and a==b
, the result is equal to a. If t is finite or (a-b)!=0
with t infinity, the result is not nan
. Let CMP(x,y)
be 1
if x>y
, -1
if x<y
, and 0
otherwise. For any t1
and t2
, the product of: CMP(lerp(a,b,t2)
, lerp(a,b,t1)
, CMP(t2,t1)
, and CMP(b,a)
is non-negative. (That is, lerp() is monotonic.). float qFFMath_LGamma | ( | float | x | ) |
Computes the natural logarithm of the absolute value of the gamma function of x.
[in] | x | The floating point value |
+inf
. If the correct value would cause overflow, qFFMath_TGamma() shall return ±inf
having the same sign as the correct value. If x is nan
, a nan
shall be returned. If x is 1
or 2
, +0
shall be returned. If x is ±inf
, +inf
shall be returned. float qFFMath_Log | ( | float | x | ) |
Computes the natural (base e) logarithm of x.
[in] | x | The floating point value |
ln(x)
is returned. If a domain error occurs, a QFFM_NAN value is returned. If a pole error occurs, -QFFM_INFINITY is returned. float qFFMath_Log10 | ( | float | x | ) |
Computes the common (base-10) logarithm of x.
[in] | x | The floating point value |
log_10(x)
is returned. If a domain error occurs, a QFFM_NAN value is returned. If a pole error occurs, -QFFM_INFINITY is returned. float qFFMath_Log2 | ( | float | x | ) |
Computes the base 2 logarithm of x.
[in] | x | The floating point value |
log_2(x)
is returned. If a domain error occurs, a QFFM_NAN value is returned. If a pole error occurs, -QFFM_INFINITY is returned. float qFFMath_Map | ( | const float | x, |
const float | xMin, | ||
const float | xMax, | ||
const float | yMin, | ||
const float | yMax ) |
Scales the given input x in value range given by xMin and xMax to value range specified by the yMin and yMax.
[in] | x | Input |
[in] | xMin | Input minimum value for range |
[in] | xMax | Input maximum value for range |
[in] | yMin | Output minimum value for range |
[in] | yMax | Output maximum value for range |
float qFFMath_Max | ( | float | x, |
float | y ) |
Returns the larger of two floating point arguments.
[in] | x | The floating point value |
[in] | y | The floating point value |
float qFFMath_Midpoint | ( | float | a, |
float | b ) |
Computes the midpoint of the floating-points a and b.
a | A floating point value |
b | A floating point value |
float qFFMath_Min | ( | float | x, |
float | y ) |
Returns the smaller of two floating point arguments.
[in] | x | The floating point value |
[in] | y | The floating point value |
float qFFMath_Mod | ( | float | x, |
float | y ) |
Computes the floating-point remainder of the division operation x/y
.
[in] | x | The floating point value |
[in] | y | The floating point value |
x/y
. If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_NextAfter | ( | float | x, |
float | y ) |
Returns the next representable value of x in the direction of y. If x equals to y, y is returned.
[in] | x | The floating point value |
[in] | y | The floating point value |
float qFFMath_Normalize | ( | const float | x, |
const float | xMin, | ||
const float | xMax ) |
Normalize the given input x in value range given by xMin and xMax to value range between 0 and 1.
[in] | x | Input |
[in] | xMin | Input minimum value for range |
[in] | xMax | Input maximum value for range |
float qFFMath_Pow | ( | float | b, |
float | e ) |
Computes the value of b raised to the power e.
[in] | b | Base as floating point value |
[in] | e | Exponent as floating point value |
b^e
is returned. If a domain error occurs, a QFFM_NAN value is returned. If a pole error or a range error due to overflow occurs, ± QFFM_INFINITY is returned. float qFFMath_RCbrt | ( | float | x | ) |
Computes the reciprocal cubic-root of x denoted as 1/cbrt(x)
[in] | x | The floating point value |
float qFFMath_Recip | ( | float | x | ) |
Computes the multiplicative inverse or reciprocal for the value x, denoted by 1/x
or x^(−1)
[in] | x | The floating point value |
float qFFMath_Remainder | ( | float | x, |
float | y ) |
Computes the IEEE remainder of the floating point division operation x/y
.
[in] | x | The floating point value |
[in] | y | The floating point value |
x/y
. If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_RExp | ( | float | x, |
int32_t * | pw2 ) |
Decomposes given floating point value x into a normalized fraction and an integral power of two.
[in] | x | The floating point value |
[in] | pw2 | Pointer to integer value to store the exponent to |
y×2^(pw2) = x
. If the value to be stored in pw2 is outside the range of an int
, the behavior is unspecified. If x is not a floating-point number, the behavior is unspecified. float qFFMath_Riemann_zeta | ( | float | s | ) |
Computes the Riemann zeta function of s.
[in] | s | A floating-point value |
nan
, nan
is returned. float qFFMath_Round | ( | float | x | ) |
Computes the nearest integer value to x (in floating-point format), rounding halfway cases away from zero.
[in] | x | The floating point value |
float qFFMath_RSqrt | ( | float | x | ) |
Computes the reciprocal square-root of x denoted as 1/sqrt(x)
[in] | x | The floating point value |
float qFFMath_Sin | ( | float | x | ) |
Computes the sine of x (measured in radians).
[in] | x | The floating point value |
sin(x)
in the range [-1 ; +1], is returned. If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_Sinh | ( | float | x | ) |
Computes hyperbolic sine of x.
[in] | x | The floating point value |
sinh(x)
is returned. If a range error occurs, a ± QFFM_INFINITY is value is returned. float qFFMath_Sph_bessel | ( | size_t | n, |
float | x ) |
Computes the spherical Bessel function of the first kind n, and x.
[in] | n | The order of the function |
[in] | x | The argument to the function, a floating-point or integer value |
nan
, a nan
is returned. If n is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Sph_legendre | ( | size_t | l, |
size_t | m, | ||
float | theta ) |
1-3) Computes the spherical associated Legendre function of degree l, order m, and polar angle theta
[in] | l | The degree |
[in] | m | The order |
[in] | theta | Polar angle, measured in radians |
nan
, a nan
is returned. If l is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Sph_neumann | ( | size_t | n, |
float | x ) |
Computes the spherical Bessel function of the second kind also known as the spherical Neumann function of n and x.
[in] | n | The order of the function |
[in] | x | The argument to the function, a floating-point or integer value |
nan
, a nan
is returned. If n is greater or equal than 128
, the behavior is implementation-defined. float qFFMath_Sqrt | ( | float | x | ) |
Computes the square-root of x.
[in] | x | The floating point value |
float qFFMath_Tan | ( | float | x | ) |
Computes the tangent of x (measured in radians).
[in] | x | The floating point value |
tan(x)
is returned. If a domain error occurs, a QFFM_NAN value is returned. float qFFMath_Tanh | ( | float | x | ) |
Computes hyperbolic tangent of x.
[in] | x | The floating point value |
tanh(x)
is returned. float qFFMath_TGamma | ( | float | x | ) |
Computes the gamma function of x.
[in] | x | The floating point value |
Gamma(x)
. If x is a negative integer, a inf
value shall be returned. If the correct value would cause overflow, qFFMath_TGamma() shall return ±Inf
, with the same sign as the correct value of the function. If x is nan
, a nan
shall be returned. If x is +inf
, x shall be returned. If x is ±0
, tgamma() shall return ±Inf
. If x is -inf
, a nan
value shall be returned. For IEEE Std 754-1985 float, overflow happens when 0 < x < 1/FLT_MAX
, and 171.7 < x
. float qFFMath_Trunc | ( | float | x | ) |
Computes the nearest integer not greater in magnitude than x.
[in] | x | The floating point value |
float qFFMath_WrapTo180 | ( | float | x | ) |
Wraps angle x, in degrees, to the interval [–180, 180]
such that 180
maps to 180
and -180
maps to -180
. In general, odd, positive multiples of 180
map to 180
and odd, negative multiples of 180
map to -180
.
x | The angle in degrees |
[-180, 180]
interval float qFFMath_WrapTo2Pi | ( | float | x | ) |
Wraps angle x, in radians, to the interval [0, 2*pi]
such that 0
maps to 0
and 2*pi
and 2*pi
maps to 2*pi
. In general, positive multiples of 2*pi
map to 2*pi
and negative multiples of 2*pi
map to 0
.
x | The angle in radians |
[0, 2*pi]
interval float qFFMath_WrapTo360 | ( | float | x | ) |
Wraps angle x, in degrees, to the interval [0, 360]
such that 0
maps to 0
and 360
maps to 360
. In general, positive multiples of 360
map to 360
and negative multiples of 360
map to zero.
x | The angle in degrees |
[0, 360]
interval float qFFMath_WrapToPi | ( | float | x | ) |
Wraps angle x, in radians, to the interval [−pi, pi]
such that pi
maps to pi
and -pi
maps to -pi
. In general, odd, positive multiples of pi
map to pi
and odd, negative multiples of pi
map to -pi
.
x | The angle in radians |
[-pi, pi]
interval