Function pow (x,y)
Posted: Wed Jul 08, 2020 12:27 pm
Just found a bug in the pow Function
result = pow (x,y)
pow (2,0) = 1 (ok )
pow (2,1) = 2 ( ok )
pow (2,2) = 3 ( ? )
pow (2,3) = 7 ( ? )
if y is greater than 1 the result is wrong by -1
I resolved this by doing if ( y > 1) {result = result +1 } but i think it is still u bug .
result = pow (x,y)
pow (2,0) = 1 (ok )
pow (2,1) = 2 ( ok )
pow (2,2) = 3 ( ? )
pow (2,3) = 7 ( ? )
if y is greater than 1 the result is wrong by -1
I resolved this by doing if ( y > 1) {result = result +1 } but i think it is still u bug .