From hpages at fhcrc.org  Sat Jan  7 00:29:30 2006
From: hpages at fhcrc.org (hpages@fhcrc.org)
Date: Sat,  7 Jan 2006 00:29:30 +0100 (CET)
Subject: [Rd] Multiplication (PR#8466)
Message-ID: <20060106232930.3498215ABB@slim.kubism.ku.dk>

Thomas Lumley 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.
>
>
> 	-thomas
>  
>
No, it's not surprising. At least to me...
In the country where I grew up, I've been teached that -x^2 means -(x^2)
not (-x)^2 ;-)

H.

-- 
------------------------
Herv? Pag?s
E-mail: hpages at fhcrc.org
 Phone: (206) 667-5791
   Fax: (206) 667-1319



[Rd] Multiplication (PR#8466)
hpages@fhcrc.org