Block-I/O in Haskell

David Brown haskell at davidb.org
Thu Oct 14 16:00:12 EDT 2004


On Thu, Oct 14, 2004 at 08:30:00PM +0100, Jon Fairbairn wrote:

> I haven't been following this discussion closely, but if the
> resolution of the timer were nanoseconds, wouldn't you run
> into trouble with Double for periods longer than about four
> months? 2**53==2**53+1 in Double on this machine.  2**53 is
> approx 9e15, but a year is only a little over 3e16ns.
> 
> Integer is the answer.

Obviously, any counter will have to be implemented with discrete values.
Floating point is actually handy here, since it allows the precision to
change depending on the scale.  It is important to implement it right,
though.

Dave


More information about the Libraries mailing list