On Wed, Aug 25, 2004 at 01:03:07PM -0400, Dan Sugalski wrote:
> Okay, as has been suggested, the type order for numbers should go:
> 
>    int->bignum->float
> 
> owing to the fact that floats are lossy and nasty. I'm not entirely 
> sure I agree, given that floats are supported in hardware and faster 

> To recap the rest of the behaviors, basic math operations (addition, 
> subtraction, multiplication, division, and modulus) produce a result 
> that's of a type no tighter than the loosest type in the operation 
> (so int+bignum gets a bignum, but int+int will be an int if the 
> result fits, or a bignum if it doesn't), and error operations 
> (division by zero, overflow, or precision loss) throw an exception.

I'm not sure that I agree, because for int,int operations (except
division with a non-integer result) you can know if the result will
fit in a float without loss.

Nicholas Clark

Reply via email to