Skip to content

Commit fc3dec6

Browse files
committed
fix: reduce modular exponentiation identity
1 parent 6e03a48 commit fc3dec6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎maths/modular_exponential.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def modular_exponential(base: int, power: int, mod: int):
2121
if power < 0:
2222
return -1
2323
base %= mod
24-
result = 1
24+
result = 1 % mod
2525

2626
while power > 0:
2727
if power & 1:

0 commit comments

Comments
 (0)