BC (which was not a leap year). In addition, the modulo operator might truncate integers to the wrong direction (ceiling instead of floor). To accommodate this, one can add a sufficient multiple of 400 Gregorian or 700 Julian years. Examples For 1 January 2000, the date would be treated as the 13th month of 1999, so the values would be: So the formula evaluates as . (The 36 comes from , truncated to an integer.) However, for 1 March 2000, the date is treated as the 3rd month of 2000, so the values become so the formula evaluates as . Implementations in software Basic modification The formulas rely on the mathematician's definition of modulo division, which means that −2 mod 7 is equal to positive 5. Unfortunately, in the truncating way most computer languages implement the remainder function, −2 mod 7 returns a result of −2. So, to implement Zeller's congruence on a computer, the formulas should be altered slightly to ensure a positive numerator. The simplest way to do this is to replace by and by . So the formulas become: for the Gregorian calendar, and for the Julian calendar. One can readily see that, in a given year, March 1 (if that is a Saturday, then March 2) is a good test date; and that, in a given century, the best test year is that which is a multiple of 100. Common simplification Zeller used decimal arithmetic, and found it convenient to use J and K in representing the year. But when using a computer, it is simpler to handle the modified year and month , which are and during January and February: for the Gregorian calendar (in this case there is no possibility of overflow because ), and for the Julian calendar. The algorithm above is mentioned for the Gregorian case in , Appendix B, albeit in an abridged form that returns 0 for Sunday. Other variations At least three other algorithms share the overall structure of Zeller's congruence in its "common simplification" type, also using an and the "modified year" construct. Michael Keith published a piece of very short C code in 1990 for Gregorian dates. The month-length component () is replaced by . J R Stockton provides a Sunday-is-0 version with , calling it a variation of Zeller. Claus Tøndering describes as a replacement. Both expressions can be shown to progress in a way that