aboutsummaryrefslogtreecommitdiff
path: root/gen/src/bool.erl
diff options
context:
space:
mode:
Diffstat (limited to 'gen/src/bool.erl')
-rw-r--r--gen/src/bool.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/gen/src/bool.erl b/gen/src/bool.erl
index e4e1108..47fba5d 100644
--- a/gen/src/bool.erl
+++ b/gen/src/bool.erl
@@ -1,7 +1,7 @@
-module(bool).
-compile(no_auto_import).
--export([negate/1, max/2, min/2, to_int/1]).
+-export([negate/1, compare/2, max/2, min/2, to_int/1]).
negate(Bool) ->
case Bool of
@@ -12,6 +12,21 @@ negate(Bool) ->
true
end.
+compare(A, B) ->
+ case {A, B} of
+ {true, true} ->
+ eq;
+
+ {true, false} ->
+ gt;
+
+ {false, false} ->
+ eq;
+
+ {false, true} ->
+ lt
+ end.
+
max(A, B) ->
case A of
true ->