|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Hang in Residue |
Date: | Mon, 8 Jan 2018 22:49:50 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
Hi Elias, the ISO APL standard says: "Note: The implementation-algorithm P modulo Q provides an exact modulo operation for realnumbers P and Q. It evaluates R←B-(×B)×|A×⌊|B÷A and return R if (×A)=×B or R+A otherwise. The definition of “mod” in the IEEE standard for Binary Floating-Point Arithmetic (754) provides an example of this exact evaluation." If I do the same computation then for some arguments I am getting strange results, probably caused by rounding errors. The only non-trivial function in the computation is above is floor(). Some of the numbers in Jay's example (e.g. 1E200) are notexact in a 64 bit float so that may as well be the cause of the problems. I anyhow wonder what can be expected from, say, 1E200 modulo 9 if there are many numbers around 1E200 that all have the same floating point representation. Maybe the old way of throwing a DOMAIN ERROR when the result becomes obscure wasn't that bad, despite of what the ISO standard asks for. Best Regards, /// Jürgen On 01/08/2018 10:17 PM, Elias Mårtenson
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |