On 7/6/2019 2:58 PM, Bob Smith wrote:
> On 7/6/2019 12:07 PM, J. Clarke wrote:
>> On Sat, 06 Jul 2019 16:37:36 +0200, Rosario19
>> wrote:
>>
>>> On Sat, 06 Jul 2019 16:36:15 +0200, Rosario19 wrote:
>>>
>>> >from the Windows calculator:
>>>> 2295655831212461065151424 / 1901165= 1207499523298851527,9586064334237
>>>>
>>> >from NARS2000
>>>> NARS2000 (Win32) Version # 0.5.5.1
>>>>
>>>>
>>>> MPIR Version #3.0.0
>>>> GMP Version #6.0.0
>>>>
>>>> floor 2295655831212461065151424x ÷ 1901165x
>>>> 1207499523298851528
>>>>
>>>> for me it should be 1207499523298851527
>>>
>>> where floor is the corrispondece character in the APL language
>>
>> Also occurs in 5.10.0.
>>
>> 'i' ?dc 2295655831212461065151424x ÷ 1901165x (where ? is quad)
>> returns 1207499523298851527
>
> As it turns out these result are all correct. The comparison with the
> Windows calculator misses the fact that APL use Comparison Tolerance
> (⎕CT) when comparing FP numbers (and NARS2000 also uses ⎕CT when
> comparing MP Integer/Rational numbers). The default value for ⎕CT in
> NARS2000 is 3E¯15, and as the actual result of the division is
> 1207499523298851527.958606433423716510666, the correct Floor of that
> number within ⎕CT is 1207499523298851528.
>
> In order to obtain the same result as the Windows calculator:
>
> ⎕CT←0
> ⌊2295655831212461065151424x ÷ 1901165x
> 1207499523298851527
>
> You might ask, Why use ⎕CT when comparing MPIRs? Some time ago I wrote
> a paper on that topic which outlines the arguments pro and con. Although
> the current implementation of NARS2000 happens to use ⎕CT when comparing
> MPIRs, in my mind, that question is still unsettled.
>
> I would greatly appreciate any comments you all might have to help
> settle it.
http://www.sudleyplace.com/APL/When%20To%20Use%20%E2%8E%95CT%20With%20Rationals.pdf
--
_________________________________________
Bob Smith -- bsmith@sudleydeplacespam.com
http://www.sudleyplace.com - http://www.nars2000.org
To reply to me directly, delete "despam".
|
|