[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Numeric for loop in Lua 5.3, thoughts reframed
- From: dyngeccetor8 <dyngeccetor8@...>
- Date: Tue, 14 Nov 2017 19:05:01 +0000
On 11/14/2017 12:49 PM, Viacheslav Usov wrote:
> My impression was that the original poster was unhappy about the "var > limit"
> condition, which, when limit is the max positive integer (or a larger floating
> point value), can never be satisfied. This is not obvious and arguably
> unexpected by programmers. Personally, I agree that having to consider that an
> intermediate value can overflow and derail the computation requires a discipline
> that would be difficult to instil upon myself or others.
Why just not call this a "bug"?
Both code snippets goes over limit value.
for i = math.mininteger, math.mininteger, -1 do
print(i)
end
for i = math.maxinteger, math.maxinteger do
print(i)
end
-- Martin