calculating a number ' range ' having set bits in the range from l to r and all other bits as 0 ( or unset ) .
$ range = ( ( ( 1 << ( $ l - 1 ) ) - 1 ) ^ ( ( 1 << ( $ r ) ) - 1 ) ) ; return ( $ n $ range ) ; }