lua-users home
lua-l archive

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


On Fri, Oct 05, 2007 at 12:33:10PM +0300, Asko Kauppi wrote:
> 
> No, I think the situation is clear and I removed % operator from  
> complex numbers in future LNUM revisions.

Well, you can define an "integer" divide as:
  a idiv b = floor(re(a/b))+i*floor(im(a/b))

If you cover the complex plane with squares build from the vector
between the origin and b, this idiv gives you the square coordinates.
>From that you can get the remainder which tells you the position of a
from the "origin corner" of the square.

Not sure if it's useful for anything though.

  OG.