[Rd] Multiplication (PR#8466)
ggrothendieck@gmail.com
ggrothendieck at gmail.com
Fri Jan 6 16:33:17 CET 2006
On 1/6/06, Thomas Lumley <tlumley at u.washington.edu> wrote:
> On Fri, 6 Jan 2006, casella at stat.ufl.edu wrote:
>
> > hi - in version 2.1 the command
> >
> > >-2^2
> >
> > gives
> >
> > -4
> >
> > as the answer. (-2)^2 is evaluated correctly.
>
> So is -2^2. The precedence of ^ is higher than that of unary minus. It
> may be surprising, but it *is* documented and has been in S for a long
> time.
See ?Syntax
More information about the R-devel
mailing list