From a7344f85f76adb8853225e6ed3406c9f84c60d80 Mon Sep 17 00:00:00 2001 From: Chetan Sanjay Shivade Date: Mon, 2 Oct 2023 23:35:46 +0530 Subject: [PATCH 1/3] Renamed maths/binary_exponentiation_2.py to binary_multiplication.py --- ...xponentiation_2.py => binary_multiplication.py} | 14 ++++++++++++++ scripts/validate_filenames.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) rename maths/{binary_exponentiation_2.py => binary_multiplication.py} (87%) diff --git a/maths/binary_exponentiation_2.py b/maths/binary_multiplication.py similarity index 87% rename from maths/binary_exponentiation_2.py rename to maths/binary_multiplication.py index af8f776dd266..aa89b8093fa0 100644 --- a/maths/binary_exponentiation_2.py +++ b/maths/binary_multiplication.py @@ -12,6 +12,14 @@ 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 +32,12 @@ def b_expo(a: int, b: int) -> int: def b_expo_mod(a: int, b: int, c: int) -> int: + """ + find Exponentiation mod + + >>> b_expo_mod(2,3,4) + 2 + """ 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: From 298a0d2082060ee925e3652a0c972856e2d514e8 Mon Sep 17 00:00:00 2001 From: Chetan Sanjay Shivade Date: Tue, 3 Oct 2023 00:02:16 +0530 Subject: [PATCH 2/3] Renamed maths/binary_exponentiation_2.py to binary_multiplication.py --- maths/binary_multiplication.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/maths/binary_multiplication.py b/maths/binary_multiplication.py index aa89b8093fa0..af8f776dd266 100644 --- a/maths/binary_multiplication.py +++ b/maths/binary_multiplication.py @@ -12,14 +12,6 @@ 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: @@ -32,12 +24,6 @@ def b_expo(a: int, b: int) -> int: def b_expo_mod(a: int, b: int, c: int) -> int: - """ - find Exponentiation mod - - >>> b_expo_mod(2,3,4) - 2 - """ res = 0 while b > 0: if b & 1: From acb7285e8659ebe37e4176fe5d7e29558f781eb3 Mon Sep 17 00:00:00 2001 From: Chetan7378 <100073874+Chetan7378@users.noreply.github.com> Date: Tue, 3 Oct 2023 00:21:50 +0530 Subject: [PATCH 3/3] Update validate_filenames.py --- scripts/validate_filenames.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate_filenames.py b/scripts/validate_filenames.py index b52f4f52fc2d..ed23f3907114 100755 --- a/scripts/validate_filenames.py +++ b/scripts/validate_filenames.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os try: