I know this is a simple question but I am thinking if there is a better way to do so.
I want to calculate the value of a deck of cards. Every card is associated with a number, i.e. there are 1 to 52 cards. I would like to extract the value of a card from a number.
The naive approach would get remainders. For example, 12 = 12 mod 13 or 14 = 1 mod 13.
But it does not work for 13, 26, 39, 52. Is there a simple way to get 13 instead of 0? Thanks in advance.