help logoLON-CAPA Help


This is a list of functions that have been written that are available in the Safe space scripting environment inside a problem:

We also support these functions from Math::Cephes


 bdtr:  Binomial distribution
 bdtrc:  Complemented binomial distribution
 bdtri:  Inverse binomial distribution
 btdtr:  Beta distribution
 chdtr:  Chi-square distribution
 chdtrc:  Complemented Chi-square distribution
 chdtri:  Inverse of complemented Chi-square distribution
 fdtr:  F distribution
 fdtrc:  Complemented F distribution
 fdtri:  Inverse of complemented F distribution
 gdtr:  Gamma distribution function
 gdtrc:  Complemented gamma distribution function
 nbdtr:  Negative binomial distribution
 nbdtrc:  Complemented negative binomial distribution
 nbdtri:  Functional inverse of negative binomial distribution
 ndtr:  Normal distribution function
 ndtri:  Inverse of Normal distribution function
 pdtr:  Poisson distribution
 pdtrc:  Complemented poisson distribution
 pdtri:  Inverse Poisson distribution
 stdtr:  Student's t distribution
 stdtri:  Functional inverse of Student's t distribution


See https://metacpan.org/pod/Math::Cephes for more information

Support for complex numbers in the Safe space scripting environment is available via the LONCAPA::LCMathComplex package, which is the standard Math::Complex module available from CPAN, modified to work in Safe space.

These functions from LONCAPA::LCMathComplex are available:

Re($z)
Im($z)
arg($z)
abs($z)

where $z is a complex number created using the Cartesian form, where $a and $b are numbers in one of the following ways:

$z = LONCAPA::LCMathComplex->make($a, $b);
$z = cplx($a, $b);
$z = $a + $b*i;

or created using the polar form, where $m and $n are numbers, in which the first argument is the modulus, and the second is the angle in radians:

$z = LONCAPA::LCMathComplex->emake($m, pi/$n);
$z = cplxe($m, pi/$n);

Where there is no overlap with function names used for Math::Cephes functions, then you can just use the LCMathComplex functions directly, e.g.. &cplx(), &Re(), &Im(), but where there is overlap, as is the case for tanh(), to ensure the function from LCMathComplex is called, include the full namespace identifier, e.g., LONCAPA::LCMathComplex::tanh().

See: https://metacpan.org/pod/Math::Complex for more information.