On Sunday, 5. October 2008 04:23:42 Darren Duncan wrote:
> Note that just as integers are naturally radix independent, the unlimited
> rationals should be too, and the latter can compactly represent all
> rationals as a triple of integers corresponding roughly to a (normalized)
> [mantissa, radix, exponent] triple; with that approach you also get 
> unlimited floats for free, so no reason to make floats an exception where
> they aren't unlimited where integers and other rationals are; after all,
> what is a float or scientific notation than just another notation for a
> rational value literal.

I want to stress this last point. We have the three types Int, Rat and Num.
What exactly is the purpose of Num? The IEEE formats will be handled
by num64 and the like. Is it just there for holding properties? Or does
it do some more advanced numeric stuff?

Another matter is how to represent irrationals. With IEEE floats which are
basically non-uniformly spaced integers imprecession is involved anyway.
But sqrt(2) is a ratio of two infinite integers. How is that handled? Here
I see a way for Num to shine as a type that also involves lazy approximations.
But then we need a way for the programmer to specify how these approximations
shall be handled. 

Regards, TSa.
"The unavoidable price of reliability is simplicity" -- C.A.R. Hoare
"Simplicity does not precede complexity, but follows it." -- A.J. Perlis
1 + 2 + 3 + 4 + ... = -1/12  -- Srinivasa Ramanujan

Reply via email to