Namespace spl.math
This namespace contains components for performing mathematical computations.
The SPL math functions are a wrapper over the underlying system math functions, and are assumed to have POSIX semantics. For example, the sin function returns the result of the system sin function, with the same accuracy and results.
Functions such as random and srand have a "process-level" scope for internal state, which corresponds to a PE scope on Streams.
By default this namespace is in scope for SPL programs, so no explicit use statement is required to use them.
Functions
- PI(): Value of PI.
- abs(T): Compute the absolute value.
- abs(T): Compute the absolute value.
- abs(complex32): Compute the absolute value.
- abs(complex64): Compute the absolute value.
- abs(list<T>): Compute the absolute value of a list.
- abs(list<T>[N]): Compute the absolute value of a list.
- acos(T): Compute the arc-cosine.
- asin(T): Compute the arcsine.
- atan(T): Compute the arc-tangent.
- avg(list<T>): Compute the average of a list.
- avg(list<T>[N]): Compute the average of a list.
- ceil(T): Compute the smallest integer value equal to or greater than a value.
- ceil(decimal32): Compute the smallest integer value equal to or greater than a value.
- ceil(decimal64): Compute the smallest integer value equal to or greater than a value.
- cos(T): Compute the cosine.
- exp(T): Compute e to a power.
- exp(T): Compute e to a power.
- floor(T): Compute the largest integer value equal to or less than a value.
- fmod(T, T): Return the floating point remainder (see man 3 fmod for details and return values).
- imag(complex32): Return the 'imaginary' part of a complex number.
- imag(complex64): Return the 'imaginary' part of a complex number.
- infl(): Return a float64 infinity.
- infw(): Return a float32 infinity.
- isInf(T): Return whether the floating point value is an infinity.
- isInf(T): Return whether the complex value is an infinity.
- isNaN(T): Return whether the floating point value is a NaN (Not A Number).
- isNaN(T): Return whether the complex value is a NaN (Not A Number).
- kthelem(list<T>, uint32): Compute the kth element in ascending order.
- kthelem(list<T>[N], uint32): Compute the kth element in ascending order.
- lg(T): Compute log base 10.
- lg(T): Compute log base 10.
- ln(T): Compute log base e.
- ln(T): Compute log base e.
- log(T): Compute log base e.
- log(T): Compute log base e.
- log10(T): Compute log base 10.
- log10(T): Compute log base 10.
- max(T, T): Compute the maximimum of two values.
- max(list<T>): Find the maximum value in a list.
- max(list<T>[N]): Find the maximum value in a list.
- median(list<T>): Compute the median of a list for numeric types that have overloaded the arithmetic operators.
- median(list<T>[N]): Compute the median of a list for numeric types that have overloaded the arithmetic operators.
- min(T, T): Compute the minimum of two values.
- min(list<T>): Find the minimum value in a list.
- min(list<T>[N]): Find the minimum value in a list.
- nanl(): Return a float64 NaN (Not A Number).
- nanw(): Return a float32 NaN (Not A Number).
- pow(T, T): Perform exponentiation.
- pow(T, T): Perform exponentiation.
- pow(T, T): Perform exponentiation.
- random(): Return a random number.
- random(int32): Return a list of random numbers.
- real(complex32): Return the 'real' part of a complex number.
- real(complex64): Return the 'real' part of a complex number.
- round(T): Round a floating point value to the nearest integer.
- sin(T): Compute the sine.
- sqrt(T): Compute the square root.
- srand(int32): Seed the random number generator.
- stddev(list<T>): Compute the standard deviation of a list.
- stddev(list<T>, boolean): Compute the standard deviation of a list.
- stddev(list<T>[N]): Compute the standard deviation of a list.
- stddev(list<T>[N], boolean): Compute the standard deviation of a list.
- sum(list<T>): Compute the sum of a list.
- sum(list<T>[N]): Compute the sum of a list.
- tan(T): Compute the tangent.