Ignore:
Timestamp:
03/05/17 15:38:09 (9 months ago)
Author:
kon
Message:

fix nano sqrd issue when making time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-19/trunk/srfi-19-support.scm

    r33841 r33883  
    561561
    562562(define-inline (normalize-timeval t t/t+1)
    563   (values (* (remainder t t/t+1) t/t+1) (quotient t t/t+1)) )
     563  (values (remainder t t/t+1) (quotient t t/t+1)) )
    564564
    565565(define (normalize-nanoseconds ns)
     
    766766; Throw away everything but the sub-second bit.
    767767;
    768 (define-syntax tm:current-sub-milliseconds
    769         (syntax-rules ()
    770                 ((_)
    771       (inexact->exact (remainder (current-milliseconds) MS/S)) ) ) )
     768(define (tm:current-sub-milliseconds)
     769        (inexact->exact (remainder (current-milliseconds) MS/S)) )
    772770
    773771(define (tm:current-nanoseconds)
     
    784782        (syntax-rules ()
    785783                ((_)
    786       (let-values (((ns sec) (tm:current-time-values)))
    787         (tm:make-time 'utc ns sec)) ) ) )
     784                  (let-values (((ns sec) (tm:current-time-values)))
     785        (tm:make-time 'utc ns sec) ) ) ) )
    788786
    789787(define-syntax tm:current-time-tai
     
    16311629        (yr (%date-year dat))
    16321630        (tzo (%date-zone-offset dat)) )
    1633     (let ((jdys (- (tm:encode-julian-day-number dy mn yr) TAI-EPOCH-IN-JD))
    1634           (secs (fx+ (fx+ (fx* hr SEC/HR) (fx+ (fx* min SEC/MIN) sec)) (fxneg tzo))) )
     1631    (let ((jdys
     1632            (-
     1633              (tm:encode-julian-day-number dy mn yr)
     1634              TAI-EPOCH-IN-JD))
     1635          (secs
     1636            (fx+
     1637              (fx+
     1638                (fx* hr SEC/HR)
     1639                (fx+
     1640                  (fx* min SEC/MIN)
     1641                  sec))
     1642              (fxneg tzo))) )
    16351643      (tm:make-time 'utc ns (+ (* (- jdys ONE-HALF) SEC/DY) secs)) ) ) )
    16361644
Note: See TracChangeset for help on using the changeset viewer.