lua-users home
lua-l archive

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


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.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7,
DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR
ROUGH. RAIN THEN FAIR. GOOD.