From 5ed34c7d05867f899f472331b75cbafc5ae5a8d6 Mon Sep 17 00:00:00 2001 From: nikikalwar Date: Thu, 17 Dec 2020 06:55:48 +0530 Subject: [PATCH] fixed the boundary condition and linted --- src/algorithms/math/fast-powering/fastPowering.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/algorithms/math/fast-powering/fastPowering.js b/src/algorithms/math/fast-powering/fastPowering.js index 2c957340..b025af77 100644 --- a/src/algorithms/math/fast-powering/fastPowering.js +++ b/src/algorithms/math/fast-powering/fastPowering.js @@ -13,12 +13,12 @@ export default function fastPowering(base, power) { // Anything that is raised to the power of zero is 1. return 1; } - - if (power < 0 ) { + + if (power < 0) { const powerNext = power * -1; const baseNext = 1 / base; - // console.log("sssss") - return fastPowering(baseNext, powerNext); + // console.log("sssss") + return fastPowering(baseNext, powerNext); } if (power % 2 === 0) {