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: Peter Bex
Subject: Re: [Chicken-users] current-time on 32-bit hardware
Date: Thu, 29 Jul 2010 11:01:26 +0200
User-agent: Mutt/1.4.2.3i

On Thu, Jul 29, 2010 at 05:34:27PM +0900, Nicolas Pelletier wrote:
> >>     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.

That's why Felix couldn't reproduce it; I'm willing to bet he tried it
on 64 bits only.
This number cannot be represented as a fixnum on a 32 bit platform,
because it requires 31 bits of storage.  There are only 30 bits available,
because one bit is used as fixnum tag and one bit is taken as the sign bit.

I'd suggest you use numbers but I don't think thread-sleep! accepts
bignums.

Felix: this kind of thing is the primary reason why I think numbers ought
to be in Chicken core.

> 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.

huh?  I don't understand that bit.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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