If you search your email you'll find that we've touched on this subject
before.
Complex residue (aka remainder, modulo) is defined the same as for real
numbers: assuming you already have a complex floor operation then Residue
←{⍵-⍺×⌊⍵÷⍺}.
Complex floor is a complex subject, especially when you
introduce comparison tolerance. I think most implementations can be traced
back to Eugene McDonnell's "Complex Floor" (
https://www.jsoftware.com/papers/eem/complexfloor.htm). See also Bob
Smith's "Complex Floor Boundaries in APL" (
http://www.sudleyplace.com/APL/Complex%20Floor%20Boundaries%20in%20APL.pdf)
and Doug Forkes's "Complex floor revisited" (
https://dl.acm.org/doi/abs/10.1145/390007.805343) and probably lots of
other papers that are currently free from the ACM.
Jay.
On Wed, 8 Apr 2020 at 06:36, Elias Mårtenson <[email protected]> wrote:
> I was reading the APL spec and noted that it specifies that the modulo
> operation is implementation-defined.
>
> I've been looking at various sources, and it's not clear to me how complex
> modulo is defined. Is there some source that documents it (and specifically
> the method used in GNU APL).
>
> Regards,
> Elias
>