Check if a number is a power of 2 or not
var isPower2 ; if ( parseInt ( ( Math . ceil ( ( Math . log ( N ) / Math . log ( N ) ) ) ) ) == parseInt ( ( Math . floor ( ( ( Math . log ( N ) / Math . log ( 2 ) ) ) ) ) ) ) { isPower2 = true ; } else { isPower2 = false ; }