Post

Avatar
Quick way to use modulus (remainder) arithmetic to quickly find the day of the week of any date in the year. Take Xmas. Today is Tue 6/11. (30-11) mod 7 = 5 + 31 mod 7 = 1 + 31 mod 7 = 4 + 30 mod 7 = 6 + 31 mod 7 = 2 + 30 mod 7 = 4 + 25 mod 7 = 1 1 means Xmas is one weekday past today, ie Wednesday