Re: [Rd] Inaccurate result for 0. (PR#13538)

From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk_at_idi.ntnu.no>
Date: Thu, 19 Feb 2009 12:30:44 +0100

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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 19 Feb 2009 - 10:49:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 19 Feb 2009 - 11:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive