Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
wruza
on March 1, 2024
|
parent
|
context
|
favorite
| on:
Ask HN: Did you encounter any leap year bugs today...
!(x % y) is the same as (x % y == 0), which means the remainder is zero, so x
is
divisible by y.
So it returns 29 if divisible by 400, 28 if divisible by 100, etc.
rep_lodsb
on March 1, 2024
[–]
Oops, you are absolutely correct!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
So it returns 29 if divisible by 400, 28 if divisible by 100, etc.