bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Access to rational number numerator and denominator


From: Frederick Pitts
Subject: Re: [Bug-apl] Access to rational number numerator and denominator
Date: Wed, 30 Aug 2017 00:59:50 -0500

Hello Jürgen,

After reading your email and the apl.html documentation on ⎕CR and so, I've have two questions:

1) How does one know B is a rational number? The apl.html documentation for 26 ⎕CR B does not show
that there is a cell type for rationals and I could not locate one in the source code. Admittedly my examination was cursory.
2) Why is a real number being used to represent the numerator of a rational number? I thought ~63-bit
integers would consistently be used to represent the parts of a rational. 26 ⎕CR ÷ 2 yields 32 indicating that 1 is being represented by a real rather than an integer. That is puzzling to me. It almost seems irrational, no pun intended.

Regards.


On Tue, 2017-08-29 at 12:51 +0200, Juergen Sauermann wrote:
Hi Fred,

the existing mechanism is 27 ⎕CR B to get the numerator of B and 28 ⎕CR to get the denominator > 0
of a quotient or 0 if the number is not a quotient (and then 27 ⎕CR is the double B cast to
uint64_t.

Unfortunately there was a bug 28 ⎕CR returning always 0. Fixed in SVN 1004.

Best Regards,
/// Jürgen


On 08/28/2017 11:24 PM, Frederick Pitts wrote:
Hello,

	Is there an existing mechanism for accessing rational number
numerator and denominator parts analogous to that for accessing complex
number real and imaginary parts?  If yes, please let me know how.  If
no, can a mechanism be implemented?

Respectfully,

Fred




reply via email to

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