[R] bug when subtracting decimals?

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Apr 20 21:13:21 CEST 2009


Dieter Menne wrote:
> wolfgang.siewert <wolfgang.siewert <at> gmail.com> writes:
> 
>> There is a way around: 
>> round(0.7-0.3,1)==0.4
>> (TRUE)
>>
>> Obviously there is a problem with some combinations of decimal subtractions,
>> that - we have the feeling - shouldt be solved.
> 
> Oh no, not that one again! This was lecture two in my first computer
> course in 1968, but it seems to be gone the way of the dodo since than.

What makes you think that the average useR has had any exposure to 
computer science courses? ;-)

I bemoan the apparent inability of those asking such questions to use 
the resources provided to solve these problems for themselves...

Gavin

> 
> Dietr
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list