diff --git a/math/binary_exponent.cpp b/math/binary_exponent.cpp index 808a36ce8..b4551da25 100644 --- a/math/binary_exponent.cpp +++ b/math/binary_exponent.cpp @@ -31,7 +31,7 @@ int binExpo(int a, int b) { /// Iterative function to calculate exponent in O(log(n)) using binary exponent. int binExpo_alt(int a, int b) { int res = 1; - while (b>0) { + while (b > 0) { if (b%2) { res = res*a; } @@ -45,9 +45,9 @@ int main() { int a, b; /// Give two numbers a, b std::cin >> a >> b; - if (a==0 && b==0) { + if (a == 0 && b == 0) { std::cout << "Math error" << std::endl; - } else if (b<0) { + } else if (b < 0) { std::cout << "Exponent must be positive !!" << std::endl; } else { int resRecurse = binExpo(a, b);