Six Months in the Life of Vector (letter)
Vector 9:2, page 7
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 7
Thank you for improving upon my submitted function in the article Six Months in the Life of Vector. It was much more interesting than my original. Unfortunately, if you type it into IBM’s APL2/PC in TryAPL2 it reveals a bug in their interpreter! Using the published example, the expression to the right of the 0 4 ⊥ should be integer 36, giving a result of 9 0. However, APL2 calculates an expression very close to 36, but gives a result of 8 4, and hence the function returns 8 5, not 9 1.
The IBM stand at APL92 was not impressed, but the Mangled-Logic APL*PLUS and Dyalogdic interpreters gave the “correct” results.
ED: Thanks John, I should have written ⌊10×A rather than relying on APL*PLUS to demote the result of the multiplication to integer. Not sure that this is a bug in any interpreter, as Encode is not ⎕CT dependent and one should not depend on an interpreter demoting floating point numbers to integer. These little things are set to trap the unwary!