lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Tony Finch <dot@dotat.at> writes:

> On Mon, 20 Sep 2010, David Kastrup wrote:
>> Tony Finch <dot@dotat.at> writes:
>> > On 20 Sep 2010, at 09:18, David Kastrup <dak@gnu.org> wrote:
>> > > Tony Finch <dot@dotat.at> writes:
>> > > >
>> > > > It can happen if the rounding mode is towards negative
>> > > > infinity.
>> > >
>> > > Please point out the line in question where this would apply.
>> >
>> > There are lots of subtractions in the code.
>>
>> Hogwash.
>
> Have a look at the Lua reference manual:
>
> 	Modulo is defined as
>
> 		a % b == a - math.floor(a/b)*b
>
> 	That is, it is the remainder of a division that rounds the
> 	quotient towards minus infinity.

"Defined as" is not the same as "implemented as".  In particular, there
is no guarantee of bug compatibility.

-- 
David Kastrup