From 8797d27e0801d37a6082ce54dac9f9d5cb01ec6c Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Mon, 22 Apr 2019 22:53:10 +0000 Subject: float:round --- test/float_test.gleam | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/float_test.gleam') 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) +} -- cgit v1.2.3