PassiveSupport.Math (passive_support v0.8.4)
Mathematical functions.
I'm not great at math.
Link to this section Summary
Functions
See :math.acos/1
.
See :math.acosh/1
.
See :math.asin/1
.
See :math.asinh/1
.
See :math.atan/1
.
See :math.atan2/2
.
See :math.atanh/1
.
See Kernel.ceil/1
.
See :math.cos/1
.
See :math.cosh/1
.
See :math.erf/1
.
See :math.erfc/1
.
See :math.exp/1
.
See Kernel.floor/1
.
See :math.fmod/2
.
See :math.log/1
.
See :math.log10/1
.
See :math.log2/1
.
See :math.pi/0
.
Raises base
to the power of exponent
.
Returns 1 if the number is positive, -1 if negative, and 0 if 0
See :math.sin/1
.
See :math.sinh/1
.
See :math.sqrt/1
.
See :math.tan/1
.
See :math.tanh/1
.
Link to this section Functions
acos(x)
See :math.acos/1
.
acosh(x)
See :math.acosh/1
.
asin(x)
See :math.asin/1
.
asinh(x)
See :math.asinh/1
.
atan(x)
See :math.atan/1
.
atan2(x, y)
See :math.atan2/2
.
atanh(x)
See :math.atanh/1
.
ceil(x)
See Kernel.ceil/1
.
cos(x)
See :math.cos/1
.
cosh(x)
See :math.cosh/1
.
erf(x)
See :math.erf/1
.
erfc(x)
See :math.erfc/1
.
exp(x)
See :math.exp/1
.
fact(x)
floor(x)
See Kernel.floor/1
.
fmod(x, y)
See :math.fmod/2
.
log(x)
See :math.log/1
.
log10(x)
See :math.log10/1
.
log2(x)
See :math.log2/1
.
See :math.pi/0
.
pow(base, exponent)
Specs
Raises base
to the power of exponent
.
Since :math.pow/2
always does floating point arithmetic, whereas
PassiveSupport.Integer.exponential/2
will do arbitrary precision arithmetic
if the exponent
is a positive integer, Math.pow/2
checks the types of
base
and exponent
and delegates out to the appropriate function based on
what it finds.
Examples
iex> pow(2, 5)
32
iex> pow(2, 5.0)
32.0
iex> pow(2, 200)
1606938044258990275541962092341162602522202993782792835301376
iex> pow(2.0, 2000)
** (ArithmeticError)
sign(number)
Specs
sign(number()) :: -1 | 0 | 1
Returns 1 if the number is positive, -1 if negative, and 0 if 0
sin(x)
See :math.sin/1
.
sinh(x)
See :math.sinh/1
.
sqrt(x)
See :math.sqrt/1
.
tan(x)
See :math.tan/1
.
tanh(x)
See :math.tanh/1
.