propeller.tools.math

Math functions.

abs

(abs x)

Returns the absolute value of a number.

approx=

(approx= x y epsilon)

Returns true if the absolute difference between x and y is less than or equal to some specified error level, epsilon.

ceil

(ceil x)

Returns the smallest integer greater than or equal to x.

cos

(cos x)

Returns the cosine of an angle (specified in radians).

div

(div x y)

Returns the result of floating point division between x and y.

exp

(exp x)

Returns Euler’s number (approx. 2.71) raised to the given power.

floor

(floor x)

Returns the largest integer less than or equal to x.

log

(log x base)(log x)

Returns the logarithm of x with the given base. If called with only one argument, returns the natural logarithm (base e) of the given value.

mean

(mean coll)

Returns the mean.

median

(median coll)

Returns the median.

median-absolute-deviation

(median-absolute-deviation coll)

Returns the median absolute deviation.

pow

(pow x n)

Returns the value obtained by raising the first argument to the power of the second argument.

root

(root x n)

Returns the root of x with base n.

round

(round x)

Returns the value of x rounded to the nearest integer.

sign

(sign x)

Returns the 1 if the argument is positive, -1 if the argument is negative, and 0 if the argument is zero.

sin

(sin x)

Returns the sine of an angle (specified in radians).

sqrt

(sqrt x)

Returns the square root of the given value.

square

(square x)

Returns the square of the given value.

step

(step x)

returns 1 if number is nonzero, 0 otherwise

tan

(tan x)

Returns the tangent of an angle (specified in radians).

transpose

(transpose x)

returns a vector containing the transpose of a coll of colls