ANDing with ~0x0000000F = 0xFFFFFFF0
(aka -16) rounds down to a multiple of 16, simply by resetting those bits that could make it anything other than a multiple of 16 (the 8's, 4's, 2's and 1's).
Adding 15 (0x0000000F
) first makes it round up instead of down.