numbers v5.0.0-rc0 Numbers
Summary
Functions
The absolute value of a number
Adds two Numeric a
and b
together
Divides the Numeric a
by b
Unary minus. Returns the negation of the number
Multiplies the Numeric a
with the Numeric b
Power function: computes base^exponent
,
where base
is Numeric,
and exponent
has to be an integer
Subtracts the Numeric b
from the Numeric a
Convert the custom Numeric struct to the built-in float datatype
Types
Functions
The absolute value of a number.
Depends on an implementation existing of Numbers.Protocols.Absolute
Adds two Numeric a
and b
together.
Depends on an implementation existing of Numbers.Protocol.Addition
Divides the Numeric a
by b
.
Note that this is a supposed to be a full (non-truncated) division; no rounding or truncation is supposed to happen, even when calculating with integers.
Depends on an implementation existing of Numbers.Protocol.Division
Unary minus. Returns the negation of the number.
Depends on an implementation existing of Numbers.Protocols.Minus
Multiplies the Numeric a
with the Numeric b
Depends on an implementation existing of Numbers.Protocol.Multiplication
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.)
Depends on an implementation existing of Numbers.Protocol.Exponentiation
Subtracts the Numeric b
from the Numeric a
.
Depends on an implementation existing of Numbers.Protocol.Subtraction
Convert the custom Numeric struct to the built-in float datatype.
This operation might be lossy, losing precision in the process.