Time Resolution

Ashley Yakeley ashley at semantic.org
Tue Feb 1 01:22:52 EST 2005


In article <41FE95DF.50000 at cql.com>, Seth Kurtzberg <seth at cql.com> 
wrote:

> I'm not, I hope, being pedantic here and talking about an irrelevant 
> issue.  But if you look in any first year engineering textbook (for an 
> engineering discipline other than CS), you will find that the display of 
> a value with a precision greater than the known precision of the inputs 
> is a cardinal sin.  It's the wrong answer.  The roundoff error behavior 
> is clearly going to be different.

Well, how do you feel about using Rationals everywhere? That way there's 
never any question of some irrelevant specified unused accuracy.

  newtype ClockTime = ClockTime Rational deriving (Eq, etc.)

I quite like the idea of using Rational for ClockTime, but I worry that 
it might be slow. But it does allow you to do things such as dividing 
times into n pieces and adding them all up again without error.

-- 
Ashley Yakeley, Seattle WA



More information about the Libraries mailing list