Working on ranges BITMANIPULATION

i have a doubt in working on ranges in bitmanipultion FOR MASK B why we take 2^i-1.

hi @ashishyadav45226_8f6d732bead98489 to make all one of i bits
eg 2^3-1 = 7 which is 111

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.