[Top][All Lists]

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

Re: [Bug-apl] Equals and not-equals operators for complex numbers yield

From: Juergen Sauermann
Subject: Re: [Bug-apl] Equals and not-equals operators for complex numbers yield wrong results.
Date: Mon, 20 Jan 2014 16:22:18 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5


fixed in SVN version 99, thanks for reporting this.

/// Jürgen

On 01/19/2014 11:51 PM, Frederick H. Pitts wrote:
Gentle people,

        In GNU APL 1.0, evaluating

        0J0 = 0J0

yields 0.  Replacing the equals operator with the not-equal operator and
re-evaluating yields 1.  Furthermore, evaluating

        0J0 = 0

yields 0.

        I discovered the above anomalies while attempting to write a regression
test for the encode operator.  When I attempted to compare the result of
encoding 4 in binary (i.e., 1 0 0) with 1 0 0 and then reducing with
logical and, I get 0.  That is because the two zeros in the result are
actually complex zeros and fail to compare for equality with the real
zeros in the expected answer.  Oddly enough, the leading 1 does compare
correctly.  Maybe the complex 1 demotes to real 1 and then integer 1
correctly while the complex zero does not.

        If the above behavior of complex/complex and complex/real compares for
equality/inequality is what is actually intended, the release notes and
user documentation should emphasize the fact.

        And if the above has been reported previously, please forgive my


Fred Pitts
Retired Chemical Engineer

reply via email to

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