Skip to content

Commit a544a42

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 94f0950 commit a544a42

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

maths/ceil.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
import unittest
55

6+
67
def ceil(x: float) -> int:
78
"""
89
Return the ceiling of x as an Integral.
@@ -22,12 +23,11 @@ def ceil(x: float) -> int:
2223
"""
2324
if not isinstance(x, (int, float)):
2425
raise ValueError("Input must be a float or integer")
25-
26+
2627
return int(x) if x - int(x) <= 0 else int(x) + 1
2728

2829

2930
class TestCeil(unittest.TestCase):
30-
3131
def test_ceil_float(self):
3232
self.assertEqual(ceil(1.5), 2)
3333

@@ -45,5 +45,6 @@ def test_ceil_non_numeric(self):
4545

4646
if __name__ == "__main__":
4747
import doctest
48+
4849
unittest.main()
49-
doctest.testmod()
50+
doctest.testmod()

0 commit comments

Comments
 (0)