bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Fuzzy Floor and Ceiling


From: Mike Duvos
Subject: Re: [Bug-apl] Fuzzy Floor and Ceiling
Date: Wed, 12 Aug 2015 04:48:24 -0700

Hi Jay,

Thanks.  That's an interesting bit of info.

IBM APL2 returns 5.  According to the APL2 manual, the system uses relative tolerance. 

With absolute tolerance, as long as they are still using a closed interval around the number, it should still return 5. 

If I fudge 5 by half the comparison tolerance, it returns 5 in GNU APL. 

APLs, notably STSC, sometimes approximate tolerant comparision using techniques such as masking to avoid the floating point computational overhead of doing it according to spec. 

So I guess it's close enough, give or take implementers discretion.

Regards,

Mike

On Wed, Aug 12, 2015 at 1:04 AM, Jay Foad <address@hidden> wrote:
I don't know anything about the GNU APL implementation, but I can tell
you that the definition of tolerant-floor changed between standard APL
(ISO 8485) and Extended APL (ISO 13751). In ISO 8485 the tolerance is
relative, so both your examples should definitely return 5. In
Extended APL the tolerance is absolute, so both your examples are
right on the cusp of whether they should return 5 or the next integer
up/down.

Jay.

On 12 August 2015 at 03:25, Mike Duvos <address@hidden> wrote:
>
>       ⌊5-⎕CT
> 4
>
>       ⌈5+⎕CT
> 6
>
>
> Unless something has drastically changed since I last read the APL spec,
> both of these should return 5.
>
>


reply via email to

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