diff options
author | Louis Pilfold <louis@lpil.uk> | 2019-04-22 22:53:10 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-04-22 22:54:26 +0000 |
commit | 8797d27e0801d37a6082ce54dac9f9d5cb01ec6c (patch) | |
tree | bb63c54be91b68aac6058c466d52634736549d4b /test | |
parent | 63d1ef2e449262becd654a13d1cb1462590e203f (diff) | |
download | gleam_stdlib-8797d27e0801d37a6082ce54dac9f9d5cb01ec6c.tar.gz gleam_stdlib-8797d27e0801d37a6082ce54dac9f9d5cb01ec6c.zip |
float:round
Diffstat (limited to 'test')
-rw-r--r-- | test/float_test.gleam | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/float_test.gleam b/test/float_test.gleam index 54f1463..a3bf4c1 100644 --- a/test/float_test.gleam +++ b/test/float_test.gleam @@ -64,3 +64,29 @@ pub fn floor_test() { |> float:floor |> expect:equal(_, -8.0) } + +pub fn round_test() { + 8.1 + |> float:round + |> expect:equal(_, 8) + + 8.4 + |> float:round + |> expect:equal(_, 8) + + 8.499 + |> float:round + |> expect:equal(_, 8) + + 8.5 + |> float:round + |> expect:equal(_, 9) + + -8.1 + |> float:round + |> expect:equal(_, -8) + + -7.5 + |> float:round + |> expect:equal(_, -8) +} |