On 21/04/2009 3:48 AM, Petr PIKAL wrote:
Hi
r-help-boun...@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).
I don't have Excel, but I expect OpenOffice duplicates its bugs pretty
well. And in OpenOffice I see all sorts of bugs due to this, e.g.
examples where x = y and y = z but x != z, cases where I can calculate a
number like 1 + 4.e-15 and get something different from 1, but if I
enter it directly as 1.000000000000004, it gets changed to 1.
So it only gives expected results in some tests, not others.
Duncan Murdoch
______________________________________________
R-help@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.