[Top][All Lists]

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

Re: Modulo algorithm

From: Jay Foad
Subject: Re: Modulo algorithm
Date: Wed, 8 Apr 2020 11:21:09 +0100

If you search your email you'll find that we've touched on this subject before.

 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.


On Wed, 8 Apr 2020 at 06:36, Elias Mårtenson <address@hidden> 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).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]