(Ted Harding) wrote:
...
Thus always up or always down means that the difference between
rounded numbers is always the same as between the unrounded numbers
which for other methods the differences can differ by 2.0.
This may or may not matter, but it is something to think about
when choosing
In R you may be tempted to use rounding to index something in an array. Hence
my concern and suggestion that there be another argument to round() (and
signif()) that explicitly sets the rounding mechanism.
In Fortran IDNINT does as I would expect. You could do floor(x+0.5) but many
people,
On 06/08/2007 5:46 AM, John Logsdon wrote:
In R you may be tempted to use rounding to index something in an array.
Hence
my concern and suggestion that there be another argument to round() (and
signif()) that explicitly sets the rounding mechanism.
In Fortran IDNINT does as I would
I use round() to prepare numbers for display in Sweave documents.
While I had appreciated the round to even issue before, I had not
given it much thought when automatically writing my output
functions/scripts/Sexprs...
On 04/08/07, Ted Harding [EMAIL PROTECTED] wrote:
On 04-Aug-07 21:57:28, John
that it is normal for R to give a 2 instead of 3. Date: Thu, 2
Aug 2007 22:38:49 +0200 From: [EMAIL PROTECTED] To:
[EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] -
round() strange behaviour On Thu, 2 Aug 2007, Monica Pisica wrote:
Hi, I am getting some strange results using round
On 04-Aug-07 21:57:28, John Logsdon wrote:
I must admit I had never realised this so thanks to Monica for
raising it.
Round-to-even is used for statistical reasons and there is some
point as it obviously reduces bias. But why should the decision
be to round to the nearest even number?
Hi,
I am getting some strange results using round - it seems that it depends if the
number before the decimal point is odd or even
For example:
round(1.5)[1] 2 round(2.5)[1] 2
While i would expect that round(2.5) be 3 and not 2.
Do you have any explanation for that?
I really
Monica Pisica wrote:
Hi,
I am getting some strange results using round - it seems that it depends if
the number before the decimal point is odd or even
For example:
round(1.5)[1] 2 round(2.5)[1] 2
While i would expect that round(2.5) be 3 and not 2.
Do you have
On Thu, 2 Aug 2007, Monica Pisica wrote:
Hi,
I am getting some strange results using round - it seems that it depends if
the number before the decimal point is odd or even
Yes. This is explained in the help page for round().
-thomas
Thomas Lumley Assoc.
On 2 Aug 2007 at 20:16, Monica Pisica wrote:
Hi,
I am getting some strange results using round - it seems that it depends if
the number before the decimal point is odd or even
For example:
round(1.5)[1] 2 round(2.5)[1] 2
While i would expect that round(2.5) be 3 and not 2.
didn't realize that it is
normal for R to give a 2 instead of 3. Date: Thu, 2 Aug 2007 22:38:49 +0200
From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch
Subject: Re: [R] - round() strange behaviour On Thu, 2 Aug 2007, Monica
Pisica wrote:Hi, I am getting some strange
On Thu, 2 Aug 2007, Monica Pisica wrote:
Hi,
I am getting some strange results using round - it seems that it depends if
the number before the decimal point is odd or even
For example:
round(1.5)[1] 2 round(2.5)[1] 2
While i would expect that round(2.5) be 3 and not 2.
Do you
That is what it is supposed to do.
From ?round
we get
Note that for rounding off a 5, the IEC 60559 standard is expected to
be used, “go to the even digit”. Therefore round(0.5) is 0 and
round(-1.5) is -2. However, this is dependent on OS services and on
representation error (since e.g. 0.15
13 matches
Mail list logo