New function leap-year-p

This commit is contained in:
Sudhir Shenoy 2017-07-13 07:08:58 +09:00
parent 4c57a3c0d1
commit d8025983c1

View file

@ -47,6 +47,12 @@
'double-float)))
(parse-error () nil)))))))))
(defun leap-year-p (year)
"True if given year is a leap year"
(if (zerop (mod year 100))
(zerop (mod year 400))
(zerop (mod year 4))))
(defun hms->day-fraction (hh mm ss)
(/ (+ (* hh 3600) (* mm 60) ss) 86400))