mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-07 10:00:55 +00:00
Add typing to binary_exponentiation_3.py (#9477)
This commit is contained in:
parent
97154cfa35
commit
73118b9f67
|
@ -11,7 +11,7 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def b_expo(a, b):
|
def b_expo(a: int, b: int) -> int:
|
||||||
res = 1
|
res = 1
|
||||||
while b > 0:
|
while b > 0:
|
||||||
if b & 1:
|
if b & 1:
|
||||||
|
@ -23,7 +23,7 @@ def b_expo(a, b):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def b_expo_mod(a, b, c):
|
def b_expo_mod(a: int, b: int, c: int) -> int:
|
||||||
res = 1
|
res = 1
|
||||||
while b > 0:
|
while b > 0:
|
||||||
if b & 1:
|
if b & 1:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user