From casella at stat.ufl.edu  Sat Jan  7 13:47:07 2006
From: casella at stat.ufl.edu (George Casella)
Date: Sat, 07 Jan 2006 07:47:07 -0500
Subject: [Rd] Multiplication (PR#8466)
In-Reply-To: <43BEFD47.1010605@fhcrc.org>
References: <20060106144345.5682219AC0@slim.kubism.ku.dk>
	<Pine.LNX.4.64.0601060712540.7293@homer24.u.washington.edu>
	<43BEFD47.1010605@fhcrc.org>
Message-ID: <43BFB84B.30001@stat.ufl.edu>

Thanks

Herve Pages wrote:

> 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.
> 

-- 
George Casella                  	Phone: (352) 392-1941 Ext. 204
Distinguished Professor and Chair	Cell:  (352) 682-7210
Department of Statistics  		Fax:   (352) 392-5175
University of Florida           	Email: casella at stat.ufl.edu
P.O. Box 118545
Gainesville, FL 32611-8545



[Rd] Multiplication (PR#8466)
George Casella