[R] bug when subtracting decimals?

Petr PIKAL petr.pikal at precheza.cz
Tue Apr 21 09:48:40 CEST 2009


Hi

r-help-bounces at r-project.org napsal dne 20.04.2009 19:01:46:

> 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.

Maybe that is because of Excel is so widespread now and gives expected 
results (it probably silently rounds all decimal numbers before 
calculation). 
Regards
Petr

> 
> 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