summaryrefslogtreecommitdiff
path: root/lisp/calendar/cal-mayan.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@twinsun.com>1993-08-10 04:14:17 +0000
committerPaul Eggert <eggert@twinsun.com>1993-08-10 04:14:17 +0000
commit632f9a0ea0d00dc1d7c9224b6e0f0ee1f7a6204e (patch)
treec9f5ea31fea39e18c239955e0d521fa5101d2232 /lisp/calendar/cal-mayan.el
parente7bb3aebcc1189826115069e938130cf2aa96a97 (diff)
downloademacs-632f9a0ea0d00dc1d7c9224b6e0f0ee1f7a6204e.tar.gz
emacs-632f9a0ea0d00dc1d7c9224b6e0f0ee1f7a6204e.tar.bz2
emacs-632f9a0ea0d00dc1d7c9224b6e0f0ee1f7a6204e.zip
(calendar-/, calendar-%): Remove, since floor and mod
now subsume them. All callers changed.
Diffstat (limited to 'lisp/calendar/cal-mayan.el')
-rw-r--r--lisp/calendar/cal-mayan.el29
1 files changed, 11 insertions, 18 deletions
diff --git a/lisp/calendar/cal-mayan.el b/lisp/calendar/cal-mayan.el
index f36b8224d2c..b4e4e2b3976 100644
--- a/lisp/calendar/cal-mayan.el
+++ b/lisp/calendar/cal-mayan.el
@@ -53,16 +53,9 @@
(require 'calendar)
-(defun mayan-mod (m n)
- "Returns M mod N; value is *always* non-negative when N>0."
- (let ((v (% m n)))
- (if (and (> 0 v) (> n 0))
- (+ v n)
- v)))
-
(defun mayan-adjusted-mod (m n)
"Non-negative remainder of M/N with N instead of 0."
- (1+ (mayan-mod (1- m) n)))
+ (1+ (mod (1- m) n)))
(defconst calendar-mayan-days-before-absolute-zero 1137140
"Number of days of the Mayan calendar epoch before absolute day 0.
@@ -132,9 +125,9 @@ research. Using 1232041 will give you the correlation used by Spinden.")
(defun calendar-mayan-haab-difference (date1 date2)
"Number of days from Mayan haab DATE1 to next occurrence of haab date DATE2."
- (mayan-mod (+ (* 20 (- (cdr date2) (cdr date1)))
- (- (car date2) (car date1)))
- 365))
+ (mod (+ (* 20 (- (cdr date2) (cdr date1)))
+ (- (car date2) (car date1)))
+ 365))
(defun calendar-mayan-haab-on-or-before (haab-date date)
"Absolute date of latest HAAB-DATE on or before absolute DATE."
@@ -193,10 +186,10 @@ Echo Mayan date if NOECHO is t."
"Number of days from Mayan tzolkin DATE1 to next occurrence of tzolkin DATE2."
(let ((number-difference (- (car date2) (car date1)))
(name-difference (- (cdr date2) (cdr date1))))
- (mayan-mod (+ number-difference
- (* 13 (mayan-mod (* 3 (- number-difference name-difference))
- 20)))
- 260)))
+ (mod (+ number-difference
+ (* 13 (mod (* 3 (- number-difference name-difference))
+ 20)))
+ 260)))
(defun calendar-mayan-tzolkin-on-or-before (tzolkin-date date)
"Absolute date of latest TZOLKIN-DATE on or before absolute DATE."
@@ -250,9 +243,9 @@ Returns nil if such a tzolkin-haab combination is impossible."
(difference (- tzolkin-difference haab-difference)))
(if (= (% difference 5) 0)
(- date
- (mayan-mod (- date
- (+ haab-difference (* 365 difference)))
- 18980))
+ (mod (- date
+ (+ haab-difference (* 365 difference)))
+ 18980))
nil)))
(defun calendar-read-mayan-haab-date ()