From Waclaw.Marcin.Kusnierczyk at idi.ntnu.no  Thu Feb 19 12:30:44 2009
From: Waclaw.Marcin.Kusnierczyk at idi.ntnu.no (Wacek Kusnierczyk)
Date: Thu, 19 Feb 2009 12:30:44 +0100
Subject: [Rd] Inaccurate result for 0. (PR#13538)
In-Reply-To: <d70c15d40902190301q479ea1ddi58ed2df361183ef0@mail.gmail.com>
References: <20090218201513.7C383282EF48@mail.pubhealth.ku.dk>
	<d70c15d40902190301q479ea1ddi58ed2df361183ef0@mail.gmail.com>
Message-ID: <499D42E4.4060208@idi.ntnu.no>

G?bor Cs?rdi wrote:
> Hmmm, the favorite.
>
> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
>   
hmm, an interesting quote:

"
To quote from ?The Elements of Programming Style? by Kernighan and Plauger:

    /10.0 times 0.1 is hardly ever 1.0/. 

"

so here's one example where 10.0 times 0.1 *is* 1.0:

perl -Mbignum -le 'print (10.0 * 0.1 == 1.0)'
# 1, for true

not an isolated idiosyncrazy, for that matter.

vQ



[Rd] Inaccurate result for 0. (PR#13538)
Wacek Kusnierczyk