aboutsummaryrefslogtreecommitdiff
path: root/gen/src/gleam@float.erl
diff options
context:
space:
mode:
Diffstat (limited to 'gen/src/gleam@float.erl')
-rw-r--r--gen/src/gleam@float.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/gen/src/gleam@float.erl b/gen/src/gleam@float.erl
index 0d8ec08..1d19fc7 100644
--- a/gen/src/gleam@float.erl
+++ b/gen/src/gleam@float.erl
@@ -1,7 +1,7 @@
-module(gleam@float).
-compile(no_auto_import).
--export([parse/1, to_string/1, ceiling/1, floor/1, round/1, truncate/1]).
+-export([parse/1, to_string/1, compare/2, ceiling/1, floor/1, round/1, truncate/1]).
parse(A) ->
gleam__stdlib:parse_float(A).
@@ -9,6 +9,21 @@ parse(A) ->
to_string(F) ->
gleam@iodata:to_string(gleam@iodata:from_float(F)).
+compare(A, B) ->
+ case A =:= B of
+ true ->
+ eq;
+
+ false ->
+ case A < B of
+ true ->
+ lt;
+
+ false ->
+ gt
+ end
+ end.
+
ceiling(A) ->
math:ceil(A).