Discussion:
[Bug-apl] Integer - rational reciprocal anomaly
Frederick Pitts
2017-08-16 15:17:25 UTC
Permalink
Hello all,

Using SVN 996, configured with RATIONAL_NUMBERS_WANTED=YES, I
observe the following:

⎕PS ← 1 22
÷ ¯2
╔══════════════════════╗
║1÷18446744073709551614║
╚══════════════════════╝
1 ÷ ¯2
╔════╗
║¯1÷2║
╚════╝
÷ 2
╔═══╗
║1÷2║
╚═══╝
1 ÷ 2
╔═══╗
║1÷2║
╚═══╝
The first result above is wrong. Additionally, taking the
reciprocal of any other negative integer yields an incorrect result.

Regards,

Fred
Juergen Sauermann
2017-08-16 16:21:20 UTC
Permalink
Hi Fred,

thanks, fixed in *SVN 998*.

I also changed the alignment of quotients in columns
from align to E to align to decimal dot. The previous
example from Ala'a now looks like this:

* ⎕PS ← 1 0**
** n,⍪{+/1÷3⋆⍳⍵}¨n←⍳40**
** 1 1÷3**
** 2 4÷9**
** 3 13÷27**
** 4 40÷81**
** 5 121÷243**
** ...**
**37 225141952945498681÷450283905890997363**
**38 675425858836496044÷1350851717672992089**
**39 2026277576509488133÷4052555153018976267**
**40 0.5*

/// Jürgen
Post by Frederick Pitts
Hello all,
Using SVN 996, configured with RATIONAL_NUMBERS_WANTED=YES, I
⎕PS ← 1 22
÷ ¯2
╔══════════════════════╗
║1÷18446744073709551614║
╚══════════════════════╝
1 ÷ ¯2
╔════╗
║¯1÷2║
╚════╝
÷ 2
╔═══╗
║1÷2║
╚═══╝
1 ÷ 2
╔═══╗
║1÷2║
╚═══╝
The first result above is wrong. Additionally, taking the
reciprocal of any other negative integer yields an incorrect result.
Regards,
Fred
Loading...