[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] srfi-19 time, flonums and s11n
From: |
Shawn Rutledge |
Subject: |
Re: [Chicken-users] srfi-19 time, flonums and s11n |
Date: |
Mon, 3 Sep 2007 13:15:47 -0700 |
On 9/3/07, Shawn Rutledge <address@hidden> wrote:
> On 9/3/07, John Cowan <address@hidden> wrote:
> > So go with the flonums; they're simpler.
>
> If I take that approach maybe it makes more sense to use srfi-18 time
> objects. They consist of only a single flonum, right? rather than
>From using it, it looks like that's how it is, but it's not.
(define (seconds->time n)
(##sys#check-number n 'seconds->time)
(let* ([n2 (max 0 (- n C_startup_time_seconds))] ; seconds since startup
[ms (truncate (* 1000 (##sys#flonum-fraction
(##sys#exact->inexact n))))] ; milliseconds
[n3 (inexact->exact (truncate (+ (* n2 1000) ms)))] ) ;
milliseconds since startup
(##sys#make-structure 'time n3 (truncate n) (inexact->exact ms)) ) )
Re: [Chicken-users] srfi-19 time, flonums and s11n, Shawn Rutledge, 2007/09/03
- Re: [Chicken-users] srfi-19 time, flonums and s11n,
Shawn Rutledge <=
Re: [Chicken-users] srfi-19 time, flonums and s11n, john, 2007/09/03
Re: [Chicken-users] srfi-19 time, flonums and s11n, felix winkelmann, 2007/09/03