4.6.2 Numeric functions
The following functions can be applied to numeric
objects and will be
evaluated immediately:
Name | Function
|
inverse(z)
| returns 1/z
|
pow(a, b)
| exponentiation a^b
|
abs(z)
| absolute value
|
real(z)
| real part
|
imag(z)
| imaginary part
|
csgn(z)
| complex sign (returns an int )
|
step(x)
| step function (returns an numeric )
|
numer(z)
| numerator of rational or complex rational number
|
denom(z)
| denominator of rational or complex rational number
|
sqrt(z)
| square root
|
isqrt(n)
| integer square root
|
sin(z)
| sine
|
cos(z)
| cosine
|
tan(z)
| tangent
|
asin(z)
| inverse sine
|
acos(z)
| inverse cosine
|
atan(z)
| inverse tangent
|
atan(y, x)
| inverse tangent with two arguments
|
sinh(z)
| hyperbolic sine
|
cosh(z)
| hyperbolic cosine
|
tanh(z)
| hyperbolic tangent
|
asinh(z)
| inverse hyperbolic sine
|
acosh(z)
| inverse hyperbolic cosine
|
atanh(z)
| inverse hyperbolic tangent
|
exp(z)
| exponential function
|
log(z)
| natural logarithm
|
Li2(z)
| dilogarithm
|
zeta(z)
| Riemann's zeta function
|
tgamma(z)
| gamma function
|
lgamma(z)
| logarithm of gamma function
|
psi(z)
| psi (digamma) function
|
psi(n, z)
| derivatives of psi function (polygamma functions)
|
factorial(n)
| factorial function n!
|
doublefactorial(n)
| double factorial function n!!
|
binomial(n, k)
| binomial coefficients
|
bernoulli(n)
| Bernoulli numbers
|
fibonacci(n)
| Fibonacci numbers
|
mod(a, b)
| modulus in positive representation (in the range [0, abs(b)-1] with the sign of b, or zero)
|
smod(a, b)
| modulus in symmetric representation (in the range [-iquo(abs(b)-1, 2), iquo(abs(b), 2)] )
|
irem(a, b)
| integer remainder (has the sign of a, or is zero)
|
irem(a, b, q)
| integer remainder and quotient, irem(a, b, q) == a-q*b
|
iquo(a, b)
| integer quotient
|
iquo(a, b, r)
| integer quotient and remainder, r == a-iquo(a, b)*b
|
gcd(a, b)
| greatest common divisor
|
lcm(a, b)
| least common multiple
|
|
Most of these functions are also available as symbolic functions that can be
used in expressions (see section Mathematical functions) or, like gcd()
,
as polynomial algorithms.