mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Add typing to binary_exponentiation_3.py (#9477)
This commit is contained in:
@ -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:
|
||||||
|
Reference in New Issue
Block a user