Skip to content

5.5 Math and Random Functions

Claude Roux edited this page Jan 27, 2022 · 2 revisions

Math

back

(fabs (val) calculates the absolute value of a float type number)
(acos (val) calculates the arc cosine)
(acosh (val) calculates the hyperbolic arc cosine)
(asin (val) calculates the sine arc)
(asinh (val) calculates the hyperbolic sine arc)
(atan (val) calculates the tangent arc)
(atanh (val) calculates the hyperbolic arc tangent)
(cbrt (val) calculates the cubic root)
(cos (val) calculates the cosine)
(cosh (val) calculates the hyperbolic cosine)
(erf (val) calculates the error function)
(erfc (val) calculates the complementary error function)
(exp (val) returns e high to the requested power)
(exp2 (val) returns 2 high to the requested power)
(expm1 (val) returns high e to the requested power minus 1)
(floor (val) returns the nearest lower integer)
(lgamma (val) calculates the natural logarithm of the absolute value of the gamma function)
(log (val) calculates the natural logarithm (in base e))
(log10 (val) calculates the logarithmic decimal (base 10))
(log1p (val) calculates the natural logarithm (in base e) of 1 plus the given number)
(log2 (val) calculates the binary logarithm (base 2))
(logb (val) extracts the exponent of a number)
(nearbyint (val) returns the nearest integer using the current rounding method)
(rint (val) returns the closest integer using the current rounding method with exception if the result is different)
(round (val) returns the nearest integer, following the rounding rules)
(sin (val) calculates the sinus)
(sinh (val) calculates the hyperbolic sinus)
(sqrt (val) calculates the square root)
(tan (val) calculates the tangent)
(tanh (val) calculates the hyperbolic tangent)
(tgamma (val) calculates the gamma function)
(trunc (val) returns the nearest integer whose absolute value is lower)
(radian (val) converts from degree into radian)
(degree (val) converts from radian into degree)
(gcd v1 v2) Greater Common Divison
(hcf v1 v2) Higher Common Factor

Random

(random (nb) returns a random value between 0 and nb)
(shuffle (list) randomly mixes items in a list) 
(random_choice (nb list initial) returns a list of nb random values among the elements in 'list', and (initial/size list) > 1)
(uniform_distribution (nb (alpha 0) (beta 1)) Uniform discrete distribution)
(bernoulli_distribution (nb (alpha 0.5)) Bernoulli distribution)
(binomial_distribution (nb (alpha 1) (beta 0.5)) binomial distribution)
(negative_binomial_distribution (nb (alpha 1) (beta 0.5)) Negative binomial distribution)
(geometric_distribution (nb (alpha 0.5)) Geometric_distribution)
(fish_distribution (nb (alpha 1)) Fish_distribution (alpha = 1))
(exponential_distribution (nb alpha) Exponential distribution)
(gamma_distribution (nb alpha beta) Gamma distribution)
(poisson_distribution (nb (alpha 1) Poisson distribution)
(weibull_distribution (nb (alpha 1) (beta 1)) weibull distribution)
(extreme_value_distribution (nb (alpha 0) (beta 1)) Extreme Value distribution)
(normal_distribution (nb (alpha 0) (beta 1)) Normal distribution)
(lognormal_distribution (nb (alpha 0) (beta 1)) Lognormal_distribution)
(chi_squared_distribution (nb alpha) Chi-squared distribution )
(cauchy_distribution (nb (alpha 0) (beta 1)) Cauchy distribution)
(fisher_distribution (nb (alpha 1) (beta 1)) Fisher F-distribution)
(student_distribution (nb (alpha 1)) Student T-Distribution)
(discrete_distribution (nb list) Discrete distribution)
(piecewise_constant_distribution (nb inter) Piecewise constant distribution )
(piecewise_linear_distribution (nb inter) Piecewise linear distribution )
Clone this wiki locally