Sha256: 601d36f54bc9d14284e518f5d2db4e93f4a094a931ea033f4bc1fc6713814f67
Contents?: true
Size: 251 Bytes
Versions: 213
Compression:
Stored size: 251 Bytes
Contents
bool is_leap(uint year) { bool div_by(uint n) { return year % n == 0; } return div_by(4) && (!div_by(100) || div_by(400)); } unittest { assert(!is_leap(2015)); assert(is_leap(2016)); assert(!is_leap(2100)); assert(is_leap(2000)); }
Version data entries
213 entries across 213 versions & 1 rubygems