diff options
Diffstat (limited to 'gen/src/int.erl')
-rw-r--r-- | gen/src/int.erl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gen/src/int.erl b/gen/src/int.erl index d3b5939..21ad7d3 100644 --- a/gen/src/int.erl +++ b/gen/src/int.erl @@ -1,7 +1,7 @@ -module(int). -compile(no_auto_import). --export([parse/1, to_string/1, to_base_string/2]). +-export([parse/1, to_string/1, to_base_string/2, compare/2]). parse(A) -> gleam__stdlib:parse_int(A). @@ -11,3 +11,18 @@ to_string(A) -> to_base_string(A, B) -> erlang:integer_to_binary(A, B). + +compare(A, B) -> + case A =:= B of + true -> + eq; + + false -> + case A < B of + true -> + lt; + + false -> + gt + end + end. |