chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] current-time on 32-bit hardware


From: Nicolas Pelletier
Subject: Re: [Chicken-users] current-time on 32-bit hardware
Date: Thu, 29 Jul 2010 17:34:27 +0900

>>     Warning (#<thread: my-thread>): : (inexact->exact) inexact number
>> cannot be represented as an exact\
>>      number: 1189553855.
>>
>
> I can not reproduce this. On what platform are you running this
> code?

It is a 32-bit Linux on a Pentium R. If my understanding is correct,
the following call is subject to overflow (e.g. inexact->exact is
called on a number that would have its bit 30 set if represented as an
integer) after the process has been running for running for 12 days 10
hours 15 minutes 41 seconds. So yes, it is not immediately
reproducible ;-)

    (inexact->exact (truncate (+ (* (- s ss) 1000) C_ms)))

As a workaround, I can use immediate integers instead of timeout
objects in the calls to thread-sleep! and mutex-lock!, at the expense
of a few milliseconds time slip.

Regards,

-- 
Nicolas



reply via email to

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