Skip to content

Commit e77804f

Browse files
committed
[mypy] fix type annotations for project euler problem188/sol1
1 parent bcc6636 commit e77804f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

project_euler/problem_188/sol1.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"""
2020

2121

22-
# small helper function for modular exponentiation
22+
# small helper function for modular exponentiation (fast exponentiation algorithm)
2323
def _modexpt(base: int, exponent: int, modulo_value: int) -> int:
2424
"""
2525
Returns the modular exponentiation, that is the value
@@ -36,7 +36,7 @@ def _modexpt(base: int, exponent: int, modulo_value: int) -> int:
3636
if exponent == 1:
3737
return base
3838
if exponent % 2 == 0:
39-
x = _modexpt(base, exponent / 2, modulo_value) % modulo_value
39+
x = _modexpt(base, exponent // 2, modulo_value) % modulo_value
4040
return (x * x) % modulo_value
4141
else:
4242
return (base * _modexpt(base, exponent - 1, modulo_value)) % modulo_value

0 commit comments

Comments
 (0)