Function: math-leap-year-p

math-leap-year-p is a byte-compiled function defined in calc-forms.el.gz.

Signature

(math-leap-year-p YEAR &optional JULIAN)

Documentation

Non-nil if YEAR is a leap year.

If JULIAN is non-nil, then use the criterion for leap years in the Julian calendar, otherwise use the criterion in the Gregorian calendar.

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-forms.el.gz
(defun math-leap-year-p (year &optional julian)
  "Non-nil if YEAR is a leap year.
If JULIAN is non-nil, then use the criterion for leap years
in the Julian calendar, otherwise use the criterion in the
Gregorian calendar."
  (if julian
      (if (math-negp year)
	  (= (math-imod (math-neg year) 4) 1)
	(= (math-imod year 4) 0))
    (if (math-negp year)
        (setq year (math-sub -1 year)))
    (setq year (math-imod year 400))
    (or (and (= (% year 4) 0) (/= (% year 100) 0))
	(= year 0))))