# HG changeset patch # User Paul Eggert # Date 744956057 0 # Node ID 10baf5e7550f6ca5ca69749b01aa4f2835405ded # Parent aeef9d07f78de95666fed86f5240ed6d5ce537a2 (timezone-fix-time, timezone-zone-to-minute): Simplify with `abs' and `floor' functions instead of doing it ourselves. diff -r aeef9d07f78d -r 10baf5e7550f lisp/timezone.el --- a/lisp/timezone.el Tue Aug 10 04:14:17 1993 +0000 +++ b/lisp/timezone.el Tue Aug 10 04:14:17 1993 +0000 @@ -233,10 +233,7 @@ (setq timezone (string-to-int timezone))) ;; Taking account of minute in timezone. ;; HHMM -> MM - ;;(+ (* 60 (/ timezone 100)) (% timezone 100)) - ;; ANSI C compliance about truncation of integer division - ;; by eggert@twinsun.com (Paul Eggert) - (let* ((abszone (max timezone (- timezone))) + (let* ((abszone (abs timezone)) (minutes (+ (* 60 (/ abszone 100)) (% abszone 100)))) (if (< timezone 0) (- minutes) minutes)))) (t 0))) @@ -293,12 +290,7 @@ (diff (- (timezone-zone-to-minute timezone) (timezone-zone-to-minute local))) (minute (+ minute diff)) - (hour-fix - (if (< minute 0) - ;;(/ (- minute 59) 60) (/ minute 60) - ;; ANSI C compliance about truncation of integer division - ;; by eggert@twinsun.com (Paul Eggert) - (- (/ (- 59 minute) 60)) (/ minute 60)))) + (hour-fix (floor minute 60))) (setq hour (+ hour hour-fix)) (setq minute (- minute (* 60 hour-fix))) ;; HOUR may be larger than 24 or smaller than 0.