[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Integer division
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 21 Nov 2012 13:40:05 -0200
> If overflow raises an error, any computation completing without error
> will be identical to an all-float version. I think.
Not exactly, because a computation can "overflow" with floats and
not overflow with 64-bit integers. ("overflow" here means lose of
precision.) And (as you mentioned) "overflow" with floats never
raise an error.
That is a core point (as you mentioned, too): currently, Lua already
has several issues with floating-point arithmetic; these issues are
irrelevant to most users most of the time. Often they are relevant
exactly in the cases where an integer representation (with more bits in
the "mantissa") would be useful.
-- Roberto