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:
|
- Re: [Bug-apl] Hang in Residue Xiao-Yong Jin
- Re: [Bug-apl] Hang in Residue Jay Foad
- Re: [Bug-apl] Hang in Residue Juergen Sauermann
- Re: [Bug-apl] Hang in Residue Jay Foad
- Re: [Bug-apl] Hang in Residue Juergen Sauermann
- Re: [Bug-apl] Hang in Residue Jay Foad
- Re: [Bug-apl] Hang in Residue Juergen Sauermann
- Re: [Bug-apl] Hang in Residue Jay Foad
- Re: [Bug-apl] Hang in Residue Juergen Sauermann
- Re: [Bug-apl] Hang in Residue Elias Mårtenson
- Re: [Bug-apl] Hang in Residue Juergen Sauermann
- Re: [Bug-apl] Hang in Residue Xiao-Yong Jin
- Re: [Bug-apl] Hang in Residue Alexey Veretennikov
- Re: [Bug-apl] Hang in Residue Jay Foad
- Re: [Bug-apl] Hang in Residue Juergen Sauermann
- Re: [Bug-apl] Hang in Residue Jay Foad