bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Modulo or residue function is not generating consistent co


From: Frederick Pitts
Subject: Re: [Bug-apl] Modulo or residue function is not generating consistent complete residue systems for some arguments
Date: Sat, 24 Jun 2017 14:27:24 -0500

Jürgen,

Using SVN 971 and testing all possible parings of Gaussian integers where the real and imaginary parts range independently from ¯15 to 15, the residue function yields the following anomalous results

      ¯11J¯1 | ¯10J¯12 1J¯11
1J¯11 0
      ¯11J1 | ¯12J¯10  ¯1J¯11
¯1J¯11 0
       ¯1J¯11 | 10J¯12  11J¯1
11J¯1 0
      1J¯11 | 12J¯10  11J1
11J1 0
       ¯1J11 | ¯12J10  ¯11J¯1
¯11J¯1 0
        1J11 | ¯10J12  ¯11J1
¯11J1 0
       11J¯1 | 12J10 1J11
1J11 0
       11J1 | 10J12 ¯1J11
¯1J11 0

The first item in each test result line is not in the complete residue system for the given modulus as evidenced by the second item on the line.

The same test using McDonnell's APL implementations of floor and residue yields no errors.

Regards,

Fred


On Sat, 2017-06-24 at 20:21 +0200, Juergen Sauermann wrote:
Hi Fred,

I am glad to hear that. It is in SVN 971 now. It was Jay who moved us into the right
direction, thanks for that. I had used the Donell paper earlier (when designing complex
floor) but the borderline cases (i.e. when ⎕CT makes a difference) were not considered
in the paper, and the descriptions in both ISO and the APL2 language reference are
entirely misleading in that respect.

Have a nice weekend,

Best Regards,
/// Jürgen


On 06/24/2017 07:55 PM, Frederick Pitts wrote:
Hello Jürgen,

SUCCESS.

The cut-and-paste below from my platform is identical to yours

      5J3 | ¯7J6
⎕CT is: 1e-13
modulus (A) is: (5,3)
A=0 is: (0,0)
A+A=0 is: (5,3)
B÷A+A=0 is: (-0.5,1.5)
⌊B÷A+A=0 is: (0,1)
A×⌊B÷A+A=0 is: (-3,5)
B-A×⌊B÷A+A=0 is: (-4,1)
¯4J1

and 5J3 | 4J¯1 ¯4J1 give the correct answer too.

If you want, I can patch the undebugged version of Complex.cc and run a battery of tests. If not, I will wait and run the tests on the next SVN version.

I think i need to find something useful to do with Gaussian integers.

Regards,

Fred


reply via email to

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