This video below tells you how it woks in a beautiful and very simple way. You can then read more about it here, if you are interested.
xP - x -> must be a multiple of P.
Example: 45 - 4 = 1024 - 4 = 1020, multiple of 5.
What a beautiful result, what simplicity - and like the video says, how useful it became!