Commit 533767f
Doomsday Algorithm: Fix leap year check (#12396)
* Fix leap year check
Replace `!=` in `(year % 400) != 0` (line 49) with `==`
Justification: Years that are divisible by 100 (centurian == 100) but not by 400 (year % 400 != 0) are skipped and NOT leap year.
* Update parentheses
Correct the parentheses to make clear the precedence of the conditional check
* Update other/doomsday.py
Co-authored-by: Tianyi Zheng <[email protected]>
---------
Co-authored-by: Tianyi Zheng <[email protected]>1 parent 0040ad4 commit 533767f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments