Function to calculate and return the power of any given number
function power ( num , n ) { if ( n == 0 ) return 1 ; else if ( n % 2 == 0 ) return power ( num , parseInt ( n / 2 ) ) * power ( num , parseInt ( n / 2 ) ) ; else return num * power ( num , parseInt ( n / 2 ) ) * power ( num , parseInt ( n / 2 ) ) ; }