emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/cal-dst.el


From: Luc Teirlinck
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/cal-dst.el
Date: Wed, 14 Jul 2004 19:25:03 -0400

Index: emacs/lisp/calendar/cal-dst.el
diff -c emacs/lisp/calendar/cal-dst.el:1.20 emacs/lisp/calendar/cal-dst.el:1.21
*** emacs/lisp/calendar/cal-dst.el:1.20 Mon Sep  1 15:45:19 2003
--- emacs/lisp/calendar/cal-dst.el      Wed Jul 14 23:22:14 2004
***************
*** 70,83 ****
  (defun calendar-time-from-absolute (abs-date s)
    "Time of absolute date ABS-DATE, S seconds after midnight.
  
! Returns the pair (HIGH . LOW) where HIGH and LOW are the high and low
  16 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC,
  ignoring leap seconds, that is the equivalent moment to S seconds after
  midnight UTC on absolute date ABS-DATE."
    (let* ((a (- abs-date calendar-system-time-basis))
           (u (+ (* 163 (mod a 512)) (floor s 128))))
      ;; Overflow is a terrible thing!
!     (cons
       ;; floor((60*60*24*a + s) / 2^16)
       (+ a (* 163 (floor a 512)) (floor u 512))
       ;; (60*60*24*a + s) mod 2^16
--- 70,83 ----
  (defun calendar-time-from-absolute (abs-date s)
    "Time of absolute date ABS-DATE, S seconds after midnight.
  
! Returns the list (HIGH LOW) where HIGH and LOW are the high and low
  16 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC,
  ignoring leap seconds, that is the equivalent moment to S seconds after
  midnight UTC on absolute date ABS-DATE."
    (let* ((a (- abs-date calendar-system-time-basis))
           (u (+ (* 163 (mod a 512)) (floor s 128))))
      ;; Overflow is a terrible thing!
!     (list
       ;; floor((60*60*24*a + s) / 2^16)
       (+ a (* 163 (floor a 512)) (floor u 512))
       ;; (60*60*24*a + s) mod 2^16




reply via email to

[Prev in Thread] Current Thread [Next in Thread]