diff options
author | Louis Pilfold <louis@lpil.uk> | 2019-04-22 22:45:06 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-04-22 22:45:06 +0000 |
commit | 63d1ef2e449262becd654a13d1cb1462590e203f (patch) | |
tree | ae25e58718e1ff54a6454fd181af405eff36849d /test | |
parent | 077aaf3468c640b84ff53fc92171292ddae55bf4 (diff) | |
download | gleam_stdlib-63d1ef2e449262becd654a13d1cb1462590e203f.tar.gz gleam_stdlib-63d1ef2e449262becd654a13d1cb1462590e203f.zip |
float:ceiling, float:floor
Diffstat (limited to 'test')
-rw-r--r-- | test/float_test.gleam | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/float_test.gleam b/test/float_test.gleam index 161f6df..54f1463 100644 --- a/test/float_test.gleam +++ b/test/float_test.gleam @@ -36,3 +36,31 @@ pub fn to_string_test() { |> float:to_string |> expect:equal(_, "-8.1") } + +pub fn ceiling_test() { + 8.1 + |> float:ceiling + |> expect:equal(_, 9.0) + + -8.1 + |> float:ceiling + |> expect:equal(_, -8.0) + + -8.0 + |> float:ceiling + |> expect:equal(_, -8.0) +} + +pub fn floor_test() { + 8.1 + |> float:floor + |> expect:equal(_, 8.0) + + -8.1 + |> float:floor + |> expect:equal(_, -9.0) + + -8.0 + |> float:floor + |> expect:equal(_, -8.0) +} |