[R] Logical inconsistency

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Sun Dec 7 09:51:23 CET 2008


Stavros Macrakis wrote:
> On Sat, Dec 6, 2008 at 4:32 PM, Wacek Kusnierczyk <
> Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:
>
>   
>> Stavros Macrakis wrote:
>>     
>>> On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk <
>>> Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:
>>>       
>>>> yepp, though (2/3)*3 not evaluating to 2 is again not a must, is it.
>>>>         
>>> Why is that less a must than .3-.2 == .1?  On the contrary, the computing
>>> convention (and for that matter the usual scientific and engineering
>>> convention) is that a decimal point signals an approximate number.
>>>       
>> not a must, since no floating point arithmetic has to be involved here.
>>
>>     
>
> Floating-point is not the issue here.  Fixed point is just as bad.  The
> problem is that it is a binary fraction, not a decimal fraction.  It is
> perfectly possible to do decimal arithmetic in computers, and it is useful
> for commerical, but not scientific/engineering calculations.
>
>   
yes yes, the point was that (* (/ 2 3) 3) does not require non-integer
arithmetic.


>> Yes, Scheme uses standard (correctly rounded) IEEE floating point, but of
>> course other cases like 15.0/22.0*22.0 are not exact.
>>     
>
> (* (/ 2.0 3.0) 3.0) is not exact either, as aren't (* (/ 2.0 2.0) 2.0)
>   
>> and 2.0; this was a teaser ;)
>>
>>     
>
> Actually, they *are* all exact in any system using IEEE floats.
>   

not per definitionem of exactness as of r6rs, as of my understanding. 
(exact? 2.0) is false there.

vQ



More information about the R-help mailing list