New function leap-year-p
This commit is contained in:
parent
4c57a3c0d1
commit
d8025983c1
1 changed files with 6 additions and 0 deletions
|
|
@ -47,6 +47,12 @@
|
||||||
'double-float)))
|
'double-float)))
|
||||||
(parse-error () nil)))))))))
|
(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)
|
(defun hms->day-fraction (hh mm ss)
|
||||||
(/ (+ (* hh 3600) (* mm 60) ss) 86400))
|
(/ (+ (* hh 3600) (* mm 60) ss) 86400))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue