FunFunc v0.2.0 FunFunc.Num
Functions for Number.
Link to this section Summary
Functions
Returns division and remainder
Checks the value is a negative number
Checks the value is not zero
Checks the value is a positive number
Predecessor function
Successor function
Iterates function for x times
Checks the value is zero
Link to this section Functions
Returns division and remainder.
Examples
iex> FunFunc.Num.divmod(5, 2)
{2, 1}
iex> FunFunc.Num.divmod(5, 0)
** (ArithmeticError) bad argument in arithmetic expression
Checks the value is a negative number.
Examples
iex> FunFunc.Num.negative?(1)
false
iex> FunFunc.Num.negative?(0)
false
iex> FunFunc.Num.negative?(-1)
true
Checks the value is not zero.
Examples
iex> FunFunc.Num.non_zero?(0)
false
iex> FunFunc.Num.non_zero?(1)
true
Checks the value is a positive number.
Examples
iex> FunFunc.Num.positive?(1)
true
iex> FunFunc.Num.positive?(0)
false
iex> FunFunc.Num.positive?(-1)
false