[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [Bug-apl] Equals and not-equals operators for complex numbers yield wron

**From**: |
Frederick H. Pitts |

**Subject**: |
[Bug-apl] Equals and not-equals operators for complex numbers yield wrong results. |

**Date**: |
Sun, 19 Jan 2014 16:51:42 -0600 |

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
intrusion.
Regards
Fred Pitts
Retired Chemical Engineer

**[Bug-apl] Equals and not-equals operators for complex numbers yield wrong results.**,
*Frederick H. Pitts* **<=**