[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modulo (for complex)
- From: Olivier Galibert <galibert@...>
- Date: Fri, 5 Oct 2007 18:31:59 +0200
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.