[Tutor] Floor and modulus for complex arguments

Angus Rodgers angusr at bigfoot.com
Fri Jul 3 15:23:12 CEST 2009

```I'm a little confused by: (i) the definition of the modulus and
floor division functions for complex arguments; (ii) the fact
that these functions for complex arguments are now "deprecated";
and (iii) the fact that the math.floor() function is not defined
at all for a complex argument.

mathematics, rather than any particular programming language),
I /think/ I would be naturally inclined to define:

floor(x + yj) = floor(x) + floor(y)j     for all real x, y

z % w = z - floor(z / w) * w    for all complex z, w (!= 0)

These seem like they would be mathematically useful definitions
(e.g. in algebraic number theory, where one has to find the
"nearest" Gaussian integer multiple of one Gaussian integer to
another - I forget the details, but it has something to do with
norms and Euclidean domains), and I don't understand why Python
doesn't do it this way, rather than first defining it a different
way (whose mathematical usefulness is not immediately apparent
to me) and then "deprecating" the whole thing!  It seems like
a wasted opportunity - but am I missing something?