This is the standard behavior of floating point arithmetic on a
digital computer. Computers use 53-bit finite precision arithmetic.
They do not use infinite precision real numbers. Please see FAQ 7.31
for details.
The FAQ is in the R documentation on your computer in file
system.file("../../do
FAQ 7.31.
-- Bert
(The FAQ's exist for a reason. You should read them!)
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Tue, Apr 18, 2017 at 7:53 PM, Boris St
On 19/04/17 13:55, Benjamin Robira wrote:
Dear Sir,
I writting to you as I am facing an irregularity in R that I do not know
the origin. When doing a sequence from 0 to 1 by 0.02 and assigning it to
a vector (i.e. code: a <- seq(from=0, to=1, by=0.02)) then, when I try to
use the 36th element (a
The concept of equality for numbers that are represented on a computer is
frequently misapplied. Consider:
a <- seq(from=0, to=1, by=0.02)
print(a[36])
[1] 0.7
a[36] == 0.7
[1] FALSE
print(a[36], digits=22)
[1] 0.7000666134
a[36] == 0.7001
[1] TRUE
All clear?
B.
Dear Sir,
I writting to you as I am facing an irregularity in R that I do not know
the origin. When doing a sequence from 0 to 1 by 0.02 and assigning it to
a vector (i.e. code: a <- seq(from=0, to=1, by=0.02)) then, when I try to
use the 36th element (and two others behave the same way) it is not
5 matches
Mail list logo