* Returns 1 if the given year is a leap year, 0 otherwise. */
| 107 | * Returns 1 if the given year is a leap year, 0 otherwise. |
| 108 | */ |
| 109 | NPY_NO_EXPORT int |
| 110 | is_leapyear(npy_int64 year) |
| 111 | { |
| 112 | return (year & 0x3) == 0 && /* year % 4 == 0 */ |
| 113 | ((year % 100) != 0 || |
| 114 | (year % 400) == 0); |
| 115 | } |
| 116 | |
| 117 | /* |
| 118 | * Calculates the days offset from the 1970 epoch. |
no outgoing calls
no test coverage detected