From d8025983c1b2d9b31ab9c851adc4569422b3913a Mon Sep 17 00:00:00 2001 From: Sudhir Shenoy Date: Thu, 13 Jul 2017 07:08:58 +0900 Subject: [PATCH] New function leap-year-p --- util.lisp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util.lisp b/util.lisp index 0dbf109..60c2e8b 100644 --- a/util.lisp +++ b/util.lisp @@ -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))