numbers v2.0.0 Numbers
Allows you to perform math on any kind of data structure that follows the Numeric behaviour.
This includes plain Integer and Floats, but also many custom numeric types specified in packages (such as Ratio, Decimal, Tensor, ComplexNum).
Summary
Functions
Computes the absolute value of num
Computes the unary minus of num
, also known as its negation
Power function: computes base^exponent
,
where base
is Numeric,
and exponent
has to be an integer
Tries to convert num
to a built-in floating-point number
Functions
Power function: computes base^exponent
,
where base
is Numeric,
and exponent
has to be an integer.
This means that it is impossible to calculate roots by using this function.
If base
supports direct computation of pow
, that is used. Otherwise,
the Exponentiation by Squaring algorithm is used.