diff --git a/maths/binary_exponentiation_2.py b/maths/binary_multiplication.py similarity index 83% rename from maths/binary_exponentiation_2.py rename to maths/binary_multiplication.py index af8f776dd266..e1ef9c16f62d 100644 --- a/maths/binary_exponentiation_2.py +++ b/maths/binary_multiplication.py @@ -12,6 +12,15 @@ def b_expo(a: int, b: int) -> int: + """ + Find Binary Multiplication + + >>> b_expo(2,3) + 6 + + >>> b_expo(-2,3) + -6 + """ res = 0 while b > 0: if b & 1: @@ -24,6 +33,16 @@ def b_expo(a: int, b: int) -> int: def b_expo_mod(a: int, b: int, c: int) -> int: + """ + Find Binary Exponiation Mode + Given method work like (a*b)%c + + + >>> b_expo_mod(2,3,4) + 2 + >>> b_expo_mod(2,3,3) + 0 + """ res = 0 while b > 0: if b & 1: diff --git a/scripts/validate_filenames.py b/scripts/validate_filenames.py index ed23f3907114..b52f4f52fc2d 100755 --- a/scripts/validate_filenames.py +++ b/scripts/validate_filenames.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import os try: