func v0.4.1 Func.Num

Summary

Functions

Checks the value is a negative number

Checks the value is not zero

Checks the value is a positive number

Predecessor function

Successor function

Checks the value is zero

Types

num()
num() :: number

Functions

negative?(num)
negative?(num) :: boolean

Checks the value is a negative number.

iex> Func.Num.negative?(1)
false
iex> Func.Num.negative?(0)
false
iex> Func.Num.negative?(-1)
true
non_zero?(num)
non_zero?(num) :: boolean

Checks the value is not zero.

iex> Func.Num.non_zero?(0)
false
iex> Func.Num.non_zero?(1)
true
positive?(num)
positive?(num) :: boolean

Checks the value is a positive number.

iex> Func.Num.positive?(1)
true
iex> Func.Num.positive?(0)
false
iex> Func.Num.positive?(-1)
false
pred(int)
pred(num) :: num

Predecessor function.

iex> Func.Num.pred(43)
42
succ(int)
succ(num) :: num

Successor function.

iex> Func.Num.succ(41)
42
zero?(num)
zero?(num) :: boolean

Checks the value is zero.

iex> Func.Num.zero?(0)
true
iex> Func.Num.zero?(1)
false