[Rd] prod(0, 1:1000) ; 0 * Inf etc
Berwin A Turlach
berwin at maths.uwa.edu.au
Tue Apr 22 05:10:02 CEST 2008
On Mon, 21 Apr 2008 18:40:43 +0200
Martin Maechler <maechler at stat.math.ethz.ch> wrote:
> I think most of us would expect prod(0:1000) to return 0, and ...
> ... it does.
> However, many of us also expect
> prod(x1, x2) to be equivalent to
> the same as we can expect that for min(), max(), sum() and such
> members of the "Summary" group.
Many may also expect that prod(x) and prod(rev(x)) are equivalent.
Unfortunately, this does not hold in finite precision arithmetic:
It might be better to educate useRs on finite precision arithmetic
than trying to catch such situations. Note, I am saying "better", not
More information about the R-devel