lua-users home
lua-l archive

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



There's no problem on my computer, and I did tried 4 different platforms (mipsel, armel, x86, x64) and none returns -0 with your code.

Time to check bug for your OS, your compiler or you CPU.

On Mon, Sep 20, 2010 at 12:19 AM, Mike McGonagle <mjmogo@gmail.com> wrote:
Well, here is the code that I am using, simplified to remove all the tables...

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