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 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.  Here is the code again:

order = 3
elements = order * order
size = elements * elements

for i = 0, (size - 1) do
	r = math.floor(i / elements)
	c = math.floor(i % elements)
	b = math.floor(math.floor(math.floor(r / order) * order) +
math.floor(c / order))
	br = math.floor(r % order)
	bc = math.floor(c % order)
	print(string.format("i:%f r: %f c: %f b:%f br:%f bc:%f", i, r,
c,  b, br, bc))
end

The only subtraction is (size-1), and that is 80 rather than 0-.

> It would be nice if you could try to help instead of flaming.

Being helpful is easier when you actually read what you are replying to.

-- 
David Kastrup