bug-apl
[Top][All Lists]
Advanced

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

[Bug-apl] Equal incorrect for non-real arguments


From: Kacper Gutowski
Subject: [Bug-apl] Equal incorrect for non-real arguments
Date: Tue, 15 Jul 2014 11:55:04 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

When either of arguments of = has imaginary part of magnitude greater
than comparison tolerance, a domain error is thrown.

      ⎕CT
1E¯13
      0J1 = 0J1
DOMAIN ERROR
      0J1=0J1
      ^  ^

There are no conditions under which = is allowed to throw a domain
error at all so this is serious.


When it returns a value, it's still incorrect:

      0J¯1E¯15 = 0J1E¯15
1
      1E¯15J¯1E¯15 = ¯1E¯15J1E¯15
1

Both should be 0 regardless of ⎕CT because signs differ (arguments
are not in the same half-plane).  It's handled correctly for reals:

      ¯1E¯15 = 1E¯15
0


On the other hand:

      ⎕CT
1E¯13
      1J1E¯15 = 1J1E¯14
0
      1E¯15J0 = 1E¯14J0
0
      1E¯15 = 1E¯14
1

All obviously should be 1.


-k



reply via email to

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