|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Fuzzy Floor and Ceiling |
Date: | Sat, 15 Aug 2015 13:49:48 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
Hi Mike, page 58 merely says that ⌈ and ⌊ use comparison tolerance, but not in which way. And page 133 (floor) says: "using comparison" tolerance and not "using RFUZZ". I read page 58 like this: a) ⎕CT is the same as comparison tolerance b) RFUZZ is N×⎕CT where N is the (magnitude-wise) larger of the numbers involved in a comparison. Now, the question is if for we should use ⎕CT or RFUZZ when computing ⌊B. Apparently the IBM APL2 implementation is: B is rounded to the nearest integer N if B=N is 1 The ISO standard and GNU APL first compute D←∣B-⌊B and round up if D=1 is 1. In other words, the "largest number" used to compute RFUZZ is B in IBM APL2 and 1 in the ISO standard. What I do not at all like in the IBM APL2 implementation is that ⌊B can be much larger than B which I find very counter-intuitive.. Now, both are reasonable approaches. But since the ISO standard (which was also written by IBM) explicitly says how to compute ⌊ and ⌈ (and the IBM language reference, as I read it, does not contradict), I believe it is better to follow the standard than the IBM APL2 implementation. /// Jürgen On 08/14/2015 08:54 PM, Mike Duvos
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |