Definitions of C++ counterparts of SPL native functions for math operations. More...

#include <SPL/Runtime/Type/SPLType.h>

Detailed Description

Definitions of C++ counterparts of SPL native functions for math operations.

Function Documentation

◆ nanw()

Return a float32 NaN (Not A Number).

Returns
NaN value as float32.

◆ nanl()

Return a float64 NaN (Not A Number).

Returns
NaN value as float64.

◆ infw()

Return a float32 infinity.

Returns
Infinity value as float32.

◆ infl()

Return a float64 infinity.

Returns
Infinity value as float64.

◆ real() [1/2]

Return the 'real' part of a complex number.

Parameters
Returns
'Real' part of complex number.

◆ real() [2/2]

Return the 'real' part of a complex number.

Parameters
Returns
'Real' part of complex number.

◆ imag() [1/2]

Return the 'imaginary' part of a complex number.

Parameters
Returns
'Imaginary' part of complex number.

◆ imag() [2/2]

Return the 'imaginary' part of a complex number.

Parameters
Returns
'Imaginary' part of complex number.

◆ isNaN() [1/7]

Return whether the floating point value is a NaN (Not A Number).

Parameters
Returns
The result 'true' if the value is a NaN, 'false' otherwise.

◆ isNaN() [2/7]

Return whether the floating point value is a NaN (Not A Number).

Parameters
Returns
The result 'true' if the value is a NaN, 'false' otherwise.

◆ isNaN() [3/7]

Return whether the floating point value is a NaN (Not A Number).

Parameters
Returns
The result 'true' if the value is a NaN, 'false' otherwise.

◆ isNaN() [4/7]

Return whether the floating point value is a NaN (Not A Number).

Parameters
Returns
The result 'true' if the value is a NaN, 'false' otherwise.

◆ isNaN() [5/7]

Return whether the floating point value is a NaN (Not A Number).

Parameters
Returns
The result 'true' if the value is a NaN, 'false' otherwise.

◆ isNaN() [6/7]

Return whether the complex value is a NaN (Not A Number).

Parameters
Returns
The result 'true' if either the real or imaginary component is a NaN, 'false' otherwise.

◆ isNaN() [7/7]

Return whether the complex value is a NaN (Not A Number).

Parameters
Returns
The result 'true' if either the real or imaginary component is a NaN, 'false' otherwise.

◆ isInf() [1/7]

Return whether the floating point value is an infinity.

Parameters
Returns
The result 'true' if the value is an infinity, 'false' otherwise.

◆ isInf() [2/7]

Return whether the floating point value is an infinity.

Parameters
Returns
The result 'true' if the value is an infinity, 'false' otherwise.

◆ isInf() [3/7]

Return whether the floating point value is an infinity.

Parameters
Returns
The result 'true' if the value is an infinity, 'false' otherwise.

◆ isInf() [4/7]

Return whether the floating point value is an infinity.

Parameters
Returns
The result 'true' if the value is an infinity, 'false' otherwise.

◆ isInf() [5/7]

Return whether the floating point value is an infinity.

Parameters
Returns
The result 'true' if the value is an infinity, 'false' otherwise.

◆ isInf() [6/7]

Return whether the complex value is an infinity.

Parameters
Returns
The result 'true' if either the real or imaginary component is an infinite value, 'false' otherwise.

◆ isInf() [7/7]

Return whether the complex value is an infinity.

Parameters
Returns
The result 'true' if either the real or imaginary component is an infinite value, 'false' otherwise.

◆ sqrt() [1/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [2/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [3/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [4/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [5/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [6/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [7/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [8/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [9/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [10/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [11/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [12/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [13/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sqrt() [14/14]

Compute the square root.

Parameters
Returns
Square root of the input value.

◆ sin() [1/2]

Compute the sine.

Parameters
Returns
Sine of the input value.

◆ sin() [2/2]

Compute the sine.

Parameters
Returns
Sine of the input value.

◆ cos() [1/2]

Compute the cosine.

Parameters
Returns
Cosine of the input value.

◆ cos() [2/2]

Compute the cosine.

Parameters
Returns
Cosine of the input value.

◆ tan() [1/2]

Compute the tangent.

Parameters
Returns
Tangent of the input value.

◆ tan() [2/2]

Compute the tangent.

Parameters
Returns
Tangent of the input value.

◆ asin() [1/2]

Compute the arcsine.

Parameters
Returns
Arcsine of the input value.

◆ asin() [2/2]

Compute the arcsine.

Parameters
Returns
Arcsine of the input value.

◆ acos() [1/2]

Compute the arc-cosine.

Parameters
Returns
Arccosine of the input value.

◆ acos() [2/2]

Compute the arc-cosine.

Parameters
Returns
Arccosine of the input value.

◆ atan() [1/2]

Compute the arc-tangent.

Parameters
Returns
Arctangent of the input value.

◆ atan() [2/2]

Compute the arc-tangent.

Parameters
Returns
Arctangent of the input value.

◆ PI()

Value of PI.

Returns
PI value.

◆ srand()

Seed the random number generator.

Parameters
Returns
0 on success.

◆ random() [1/2]

Return a random number.

Returns
A random value in the range 0 to 1.

◆ random() [2/2]

Return a list of random numbers.

Parameters
Returns
A list of random values each in the range 0 to 1.

◆ pow() [1/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [2/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [3/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [4/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [5/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [6/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [7/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [8/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [9/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [10/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [11/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [12/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [13/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ pow() [14/14]

Perform exponentiation.

Parameters
Returns
The input value raised to the power of the exponent.

◆ exp() [1/7]

Compute e to a power.

Parameters
Returns
The base of natural logarithms, e, raised to the power given by the input value.

◆ exp() [2/7]

Compute e to a power.

Parameters
Returns
The base of natural logarithms, e, raised to the power given by the input value.

◆ exp() [3/7]

Compute e to a power.

Parameters
Returns
The base of natural logarithms, e, raised to the power given by the input value.

◆ exp() [4/7]

Compute e to a power.

Parameters
Returns
The base of natural logarithms, e, raised to the power given by the input value.

◆ exp() [5/7]

Compute e to a power.

Parameters
Returns
The base of natural logarithms, e, raised to the power given by the input value.

◆ exp() [6/7]

Compute e to a power.

Parameters
Returns
The base of natural logarithms, e, raised to the power given by the input value.

◆ exp() [7/7]

Compute e to a power.

Parameters
Returns
The base of natural logarithms, e, raised to the power given by the input value.

◆ log() [1/7]

Compute log base e.

Parameters
Returns
Natural logarithm of the input value.

◆ log() [2/7]

Compute log base e.

Parameters
Returns
Natural logarithm of the input value.

◆ log() [3/7]

Compute log base e.

Parameters
Returns
Natural logarithm of the input value.

◆ log() [4/7]

Compute log base e.

Parameters
Returns
Natural logarithm of the input value.

◆ log() [5/7]

Compute log base e.

Parameters
Returns
Natural logarithm of the input value.

◆ log() [6/7]

Compute log base e.

Parameters
Returns
Natural logarithm of the input value.

◆ log() [7/7]

Compute log base e.

Parameters
Returns
Natural logarithm of the input value.

◆ log10() [1/7]

Compute log base 10.

Parameters
Returns
Base 10 logarithm of the input value.

◆ log10() [2/7]

Compute log base 10.

Parameters
Returns
Base 10 logarithm of the input value.

◆ log10() [3/7]

Compute log base 10.

Parameters
Returns
Base 10 logarithm of the input value.

◆ log10() [4/7]

Compute log base 10.

Parameters
Returns
Base 10 logarithm of the input value.

◆ log10() [5/7]

Compute log base 10.

Parameters
Returns
Base 10 logarithm of the input value.

◆ log10() [6/7]

Compute log base 10.

Parameters
Returns
Base 10 logarithm of the input value.

◆ log10() [7/7]

Compute log base 10.

Parameters
Returns
Base 10 logarithm of the input value.

◆ ceil() [1/4]

Compute the smallest integer value equal to or greater than a value.

Parameters
Returns
Smallest integer >= f.

◆ ceil() [2/4]

Compute the smallest integer value equal to or greater than a value.

Parameters
Returns
Smallest integer >= f.

◆ ceil() [3/4]

Compute the smallest integer value equal to or greater than a value.

Parameters
Returns
Smallest integer >= f.

◆ ceil() [4/4]

Compute the smallest integer value equal to or greater than a value.

Parameters
Returns
Smallest integer >= f.

◆ floor() [1/5]

Compute the largest integer value equal to or less than a value.

Parameters
Returns
Largest integer <= f.

◆ floor() [2/5]

Compute the largest integer value equal to or less than a value.

Parameters
Returns
Largest integer <= f.

◆ floor() [3/5]

Compute the largest integer value equal to or less than a value.

Parameters
Returns
Largest integer <= f.

◆ floor() [4/5]

Compute the largest integer value equal to or less than a value.

Parameters
Returns
Largest integer <= f.

◆ floor() [5/5]

Compute the largest integer value equal to or less than a value.

Parameters
Returns
Largest integer <= f.

◆ round() [1/5]

Round a floating point value to the nearest integer.

Parameters
Returns
The input value rounded to the nearest integer.

◆ round() [2/5]

Round a floating point value to the nearest integer.

Parameters
Returns
The input value rounded to the nearest integer.

◆ round() [3/5]

Round a floating point value to the nearest integer.

Parameters
Returns
The input value rounded to the nearest integer.

◆ round() [4/5]

Round a floating point value to the nearest integer.

Parameters
Returns
The input value rounded to the nearest integer.

◆ round() [5/5]

Round a floating point value to the nearest integer.

Parameters
Returns
The input value rounded to the nearest integer.

◆ abs() [1/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [2/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [3/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [4/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [5/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [6/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [7/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [8/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [9/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [10/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [11/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [12/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [13/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [14/16]

Compute the absolute value.

Parameters
Returns
Absolute value of f.

◆ abs() [15/16]

template<class T >

Compute the absolute value of a list.

Parameters
Returns
List of the absolute values of the elements of f.

◆ abs() [16/16]

template<class T , int32_t N>

Compute the absolute value of a list.

Parameters
Returns
List of the absolute values of the elements of f.

◆ max() [1/3]

template<class T >

Compute the maximimum of two values.

Parameters
Returns
Maximum of v1 and v2.

◆ max() [2/3]

template<class T >

Find the maximum value in a list.

Parameters
Returns
Maximum of the input values.

◆ max() [3/3]

template<class T , int32_t N>

Find the maximum value in a list.

Parameters
Returns
Maximum of the input values.

◆ min() [1/3]

template<class T >

Compute the minimum of two values.

Parameters
Returns
Minimum of v1 and v2.

◆ min() [2/3]

template<class T >

Find the minimum value in a list.

Parameters
Returns
Minimum of the input values.

◆ min() [3/3]

template<class T , int32_t N>

Find the minimum value in a list.

Parameters
Returns
Minimum of the input values.

◆ sum() [1/2]

template<class T >

Compute the sum of a list.

Parameters
Returns
Sum of the input values.

◆ sum() [2/2]

template<class T , int32_t N>

Compute the sum of a list.

Parameters
Returns
Sum of the input values.

◆ avg() [1/2]

template<class T >

Compute the average of a list.

Parameters
Returns
Average of the input values.

◆ avg() [2/2]

template<class T , int32_t N>

Compute the average of a list.

Parameters
Returns
Average of the input values.

◆ kthelem() [1/2]

template<class T >

Compute the kth element in ascending order.

Parameters
Returns
The kth element in ascending order.
Exceptions

◆ kthelem() [2/2]

template<class T , int32_t N>

Compute the kth element in ascending order.

Parameters
Returns
The kth element in ascending order.
Exceptions

◆ median() [1/2]

template<class T >

Compute the median of a list for numeric types that have overloaded the arithmetic operators. For a list with an odd number of elements, it returns the median value. For a list with an even number of elements, it returns the average of the two middlemost elements;

Parameters
Returns
Median of the input values.

◆ median() [2/2]

template<class T , int32_t N>

Compute the median of a list for numeric types that have overloaded the arithmetic operators. For a list with an odd number of elements, it returns the median value. For a list with an even number of elements, it returns the average of the two middlemost elements;

Parameters
Returns
Median of the input values.

◆ median< SPL::ustring >()

template<>

Compute the median of a list for ustring type.

If the list has an even size N, then this function returns the N/2th element of the list sorted in ascending order.

Parameters
Returns
Median of the input values.

◆ median< SPL::timestamp >()

template<>

Compute the median of a list for the timestamp type.

If the list has an even size N, then this function returns the N/2th element of the list sorted in ascending order.

Parameters
Returns
Median of the input values.

◆ median< SPL::rstring >()

template<>

Compute the median of a list for rstring type.

If the list has an even size N, then this function returns the N/2th element of the list sorted in ascending order.

Parameters
Returns
Median of the input values.

◆ stddev() [1/2]

template<class T >

Compute the standard deviation of a list.

Parameters
Returns
Standard deviation of the input values.

◆ stddev() [2/2]

template<class T , int32_t N>

Compute the standard deviation of a list.

Parameters
Returns
Standard deviation of the input values.

◆ fmod()

template<class T >

Return the floating point remainder (see man 3 fmod for details and return values).

Parameters
Returns
Floating point remainder x - n*y for some n.