bug-apl
[Top][All Lists]
Advanced

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

[Bug-apl] Integer - rational multiplication anomaly


From: Frederick Pitts
Subject: [Bug-apl] Integer - rational multiplication anomaly
Date: Tue, 15 Aug 2017 23:55:21 -0500

Hello all,

        With gnu-apl configured with RATIONAL_NUMBERS_WANTED=YES, I
observe the following:

      ⎕PS ← 1 22
      x ← 3 ÷ 1
      x + 1 ÷ 2
╔═══╗
║7÷2║
╚═══╝
      x × 1 ÷ 2
╔═══╗
║1.5║
╚═══╝

        The last result should be 3÷2. In general, multiplication of
integers and rationals should yield rationals or integers (which are
rationals with a denominator of 1), not floats.  The exception would be
when the numerator or denominator of an intermediate rational result
overflows the integer range.

Regards,

Fred 



reply via email to

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