From 650a9b22555dccc899338ace0a335c553d93c99c Mon Sep 17 00:00:00 2001 From: Marcin Pajkowski Date: Sat, 17 Aug 2019 23:08:01 +0200 Subject: [PATCH] Add tests for math.modf --- tests/snippets/math_module.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/snippets/math_module.py b/tests/snippets/math_module.py index d998f1b89..92b6f30a6 100644 --- a/tests/snippets/math_module.py +++ b/tests/snippets/math_module.py @@ -112,3 +112,9 @@ assert math.factorial(3) == 6 assert math.factorial(10) == 3628800 assert math.factorial(20) == 2432902008176640000 assert_raises(ValueError, lambda: math.factorial(-1)) + +assert math.modf(1.25) == (0.25, 1.0) +assert math.modf(-1.25) == (-0.25, -1.0) +assert math.modf(2.56) == (0.56, 2.0) +assert math.modf(-2.56) == (-0.56, -2.0) +assert math.modf(1) == (0.0, 1.0)