[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Modulo operator produces incorrect results with negative operand(s).
- From: Rain Gloom <raingloom42@...>
- Date: Tue, 24 Jan 2017 23:42:19 +0000
The choice of sign seems to vary pretty widely, so IMHO portable code should not depend on it. Since Lua has implementations in many languages and aims to be fast it would be an unreasonable tradeoff to make the underlying operation conform to the original C implementation. Modulo is already among the slower operations, so the extra overhead is not necessarily worth it.