> Jürgen, Jay, Kacper, The last time this error occurred on my platform, you could not reproduce it on yours. However, Jay Foad and Kacper Gutowski were able to reproduce the error. Hopefully one or both of them or someone else on the Bug-apl list will be able to do so again. Regards, Fred On Wed, 2017-06-14 at 14:04 +0200, Juergen Sauermann wrote: > Hi Fred, > > > > not sure what to do about that. On my machine I am getting: > > > > 1J3 ∣ 8J4 > > 0 > > > > and your TGI0.apl > program seems not to output anything. > > > > Best Regqrds, > > Jürgen Sauermann > > > > > > On 06/14/2017 05:52 AM, Frederick Pitts > wrote: > > > > > Juergen, > > > > I'm seeing errors with the mod (∣) operator applied to Gaussian > > integers again. With svn 896, the mod operator yields a nonzero > > residual result while the division operator yields an exact > > Gaussian > > integer quotient result as follows > > > > 1J3 ∣ 8J4 > > 1J3 > > 8J4 ÷ 1J3 > > 2J¯2 > > 1J3 × 2J¯2 > > 8J4 > > > > I'm running Fedora 25, 64 bit, on an Intel Core i7-6700 4 core > > CPU with 16 Gbyte memory. > > > > The attached TGI0.apl generates many more failure examples if > > needed. > > > > Regards, > > > > Fred > > > > > > > > >
#!/usr/local/bin/apl --script
⍝ Run with: ./TGI0.apl ⍝ The square root of ¯1, a pure imaginary number. ⍙J ← 0J1 ⍝ CMPLX is an array function. ∇z ← m CMPLX n z ← m + ⍙J × n ∇ ⍝ NORMJ is an array function. ∇ z ← NORMJ m z ← m × + m ∇ ∇ z ← a MODTST b; r0; r1; r2 z ← 0 → ( ( a = 0 ) ∨ z ← ( ( r1 ← NORMJ a ∣ b ) < r0 ← NORMJ a ) ) / 0 ⍞ ← "a = " ⍞ ← a ⍞ ← ", b = " ⍞ ← b ⍞ ← ", ( NORMJ a ∣ b = " ⍞ ← r1 ⍞ ← " ) ≥ ( NORMJ a = " ⍞ ← r0 ⍞ ← " )" ⎕ ← " " ⍞ ← "r2 = b ÷ a = " ⍞ ← r2 ← b ÷ a ⍞ ← ", b = r2 × a =" ⍞ ← r2 × a ⎕ ← " " ∇ cnt ← 21 bgn ← ¯1 - cnt2 ← ⌊ cnt ÷ 2 a ← b ← ints ← bgn + ⍳ cnt alpha ← ⊖ ⍉ a ∘.CMPLX b ⎕ ← " " foo ← alpha ∘.MODTST alpha ⍝ rhp ← ⍉ ( ⍳ cnt2 ) ∘.CMPLX ( bgn + ⍳ cnt ) ⍝ foo ← rhp ∘.MODTST rhp