We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent bba0c36 commit 65be417Copy full SHA for 65be417
maths/number_of_digits.py
@@ -21,7 +21,7 @@ def num_digits(n: int) -> int:
21
...
22
TypeError: Input must be an integer
23
"""
24
-
+
25
if not isinstance(n, int):
26
raise TypeError("Input must be an integer")
27
@@ -55,10 +55,10 @@ def num_digits_fast(n: int) -> int:
55
56
57
58
59
60
61
62
return 1 if n == 0 else math.floor(math.log(abs(n), 10) + 1)
63
64
@@ -82,10 +82,10 @@ def num_digits_faster(n: int) -> int:
82
83
84
85
86
87
88
89
return len(str(abs(n)))
90
91
0 commit comments