Bottle.Number (Bottle v0.1.0) View Source
Provides custom guards for numbers
Link to this section Summary
Functions
Guards that passes when a number is a pos_integer
Guards that passes when a number is a pos_number
Guards that passes when a number is 0 (including float 0.0)
Link to this section Functions
Guards that passes when a number is a pos_integer
Examples
iex> is_pos_integer(1) true
iex> is_pos_integer(1.1) false
iex> is_pos_integer(0) false
iex> is_pos_integer(-1) false
iex> is_pos_integer({"anything", "else"}) false
Guards that passes when a number is a pos_number
Examples
iex> is_pos_number(1) true
iex> is_pos_number(1.1) true
iex> is_pos_number(0) false
iex> is_pos_number(-1) false
iex> is_pos_number(-1.1) false
iex> is_pos_number({"anything", "else"}) false
Guards that passes when a number is 0 (including float 0.0)
Examples
iex> is_zero(0) true
iex> is_zero(0.0) true
iex> is_zero(1) false
iex> is_zero({"anything", "else"}) false