[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: bug, -0 is not evaluated correctly.
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 06 Jan 2005 13:37:01 -0200
An easy way to support -0 is to avoid the optimization when the value is
zero. I guess the fix would be simply the following:
lcode.c:579:
- if (e->k == VK && ttisnumber(&fs->f->k[e->info]))
+ if (e->k == VK && ttisnumber(&fs->f->k[e->info]) &&
+ nvalue(&fs->f->k[e->info]) != 0)
(Untested code for Lua 5.0.2)
The question is whether we really should care about those details...
-- Roberto