Re: Unexpected calculation result with Lua53
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Unexpected calculation result with Lua53
- From: Andrew Starks <andrew.starks@...>
- Date: Sun, 3 May 2015 12:18:43 -0500
On Saturday, May 2, 2015, Milind Gupta <
milind.gupta@gmail.com> wrote:
Convert an overflow result to floating point seems tempting, but
we do not see it as a useful/practical option. First, it is quite
expensive to check multiplication overflows in ANSI C. Second, if you
are computing with integers, you probably need a correct result, not a
rough aproximation.
I was wondering so does it mean we have to be careful when we use integer number and floating number into our programs? If that is the case wouldn't it be easier if integer type was defined separately allowing its usage explicitly when needed and thought out?
Milind
Do you mean something stronger than math.type?
It almost never matters, so the provided approach seems reasonable, I think.