View Source Moar.Integer (Moar v1.56.2)

Integer-related functions.

Summary

Functions

Compares two integers, returning :lt, :eq, or :gt.

Functions

@spec compare(integer(), integer()) :: :lt | :eg | :gt

Compares two integers, returning :lt, :eq, or :gt.

iex> Moar.Integer.compare(1, 3)
:lt

iex> Moar.Integer.compare(1, -3)
:gt

iex> Moar.Integer.compare(-1, -1)
:eq

iex> Enum.sort([5, 6, 0, -1], Moar.Integer)
[-1, 0, 5, 6]