MCPcopy Create free account
hub / github.com/numpy/numpy / is_leapyear

Function is_leapyear

numpy/core/src/multiarray/datetime.c:109–115  ·  view source on GitHub ↗

* Returns 1 if the given year is a leap year, 0 otherwise. */

Source from the content-addressed store, hash-verified

107 * Returns 1 if the given year is a leap year, 0 otherwise.
108 */
109NPY_NO_EXPORT int
110is_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.

Calls

no outgoing calls

Tested by

no test coverage detected