Find the power of a less than and greater than a
A = int ( pow ( a , log_a ) ) NEW_LINE B = int ( pow ( a , log_a + 1 ) ) NEW_LINE if ( ( arr [ i ] - A ) < ( B - arr [ i ] ) ) : NEW_LINE INDENT log_a = A NEW_LINE DEDENT else : NEW_LINE INDENT log_a = B NEW_LINE DEDENT