diff options
author | Brett Snyder <bsnyder@digitalocean.com> | 2019-10-03 08:42:01 -0500 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-10-03 14:42:01 +0100 |
commit | cc7ba56105a6f8933c2bfd25151061a94471eb23 (patch) | |
tree | bcf8a3977cb0a37bffe7be4f527436d94f7afeb1 /gen/src/gleam@int.erl | |
parent | cf7831f278423bab72f5d9433771e5a16ce44cac (diff) | |
download | gleam_stdlib-cc7ba56105a6f8933c2bfd25151061a94471eb23.tar.gz gleam_stdlib-cc7ba56105a6f8933c2bfd25151061a94471eb23.zip |
add min() for Int and Float modules (#268)
Diffstat (limited to 'gen/src/gleam@int.erl')
-rw-r--r-- | gen/src/gleam@int.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gen/src/gleam@int.erl b/gen/src/gleam@int.erl index ea97785..de9ce8b 100644 --- a/gen/src/gleam@int.erl +++ b/gen/src/gleam@int.erl @@ -1,7 +1,7 @@ -module(gleam@int). -compile(no_auto_import). --export([parse/1, to_string/1, to_base_string/2, compare/2]). +-export([parse/1, to_string/1, to_base_string/2, compare/2, min/2]). parse(A) -> gleam_stdlib:parse_int(A). @@ -26,3 +26,12 @@ compare(A, B) -> gt end end. + +min(A, B) -> + case A < B of + true -> + A; + + false -> + B + end. |