The value of 5 is that 32 = 2 ^ 5.
size = (n + 31) >> 5
sets size to ceiling(n/32) , which is the number of 32-bit integers needed to store the flags of bit n .
Appendix 31 to n is to ensure that the dividend is not less than the smallest multiple of 32 greater than or equal to n .
source share