text: Given a HUGE number check if it 's a power of two. | Function to check whether a number is power of 2 or not ; Driver code
code: function ispowerof2 ( num ) { if ( ( num & ( num - 1 ) ) == 0 ) return 1 ; return 0 ; } var num = 549755813888 ; document . write ( ispowerof2 ( num ) ) ;