lua-users home
lua-l archive

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

> > This is in C. In Lua both are equivalent; integer division in Lua rounds
> > toward minus infinity, like an arithmetic shift.
> > 
> > -- Roberto
> > 
> Interesting, and a bit worrying. Is there any reason for this?

The same reasons that made '%' in Lua assume a division that rounds
toward minus infinity . This was discussed at length when we introduced
'%' in Lua 5.2.

-- Roberto