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: Felix
Subject: Re: [Chicken-users] current-time on 32-bit hardware
Date: Thu, 29 Jul 2010 12:12:31 +0200 (CEST)

From: Peter Bex <address@hidden>
Subject: Re: [Chicken-users] current-time on 32-bit hardware
Date: Thu, 29 Jul 2010 11:01:26 +0200

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

The problem is (as Nicolas mentioned) that the time-limit stored in time
objects is the number of milliseconds since startup and that overflows a
fixnum after 13 days. 

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

That won't change anything.

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

No, the reason for this is that the scheduler uses fixnums in timeout
checks for performance reasons and because of this, the time objects
store time spans as fixnums as well. This will probably have to be
changed to use flonums.


cheers,
felix



reply via email to

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