From 538280 at gmail.com  Sun Apr 27 15:58:20 2014
From: 538280 at gmail.com (Greg Snow)
Date: Sun, 27 Apr 2014 07:58:20 -0600
Subject: [Rd] Strange behaviour of the ':' operator
In-Reply-To: <CAML4n3M3Jzmm6aCaYCjF5XGd=Swg9YgxTUU5YykXNOop2JKi6Q@mail.gmail.com>
References: <CAML4n3M3Jzmm6aCaYCjF5XGd=Swg9YgxTUU5YykXNOop2JKi6Q@mail.gmail.com>
Message-ID: <CAFEqCdwT69fBiy8J-3biqOSUaFf4GE7E9VbhEc_uguvZs=wWog@mail.gmail.com>

>From the help page ?':' we can read:

"Value ?to? will be included if it differs from ?from? by an
     integer up to a numeric fuzz of about ?1e-7?."

So it looks like it is the intended behavior.



On Sun, Apr 27, 2014 at 5:38 AM, Hans W Borchers <hwborchers at gmail.com> wrote:
> Is the following really intended behaviour of the ':' operator,
>
>     > s <- pi - 3.0 + 1e-07
>     > x <- s:pi
>     > x
>     [1] 0.1415928 1.1415928 2.1415928 3.1415928
>
> though the last entry in the range vector is greater than pi?
>
>     > x[4] > pi; x[4] - pi
>     [1] TRUE
>     [1] 1e-07
>
> and the same, of course, for the seq() function.
> I would understand this behaviour for 1e-14 or so, but it seems
> unexpected for such a distinct difference as 1e-07.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com



[Rd] Strange behaviour of the ':' operator
Greg Snow