From bolker at zoo.ufl.edu  Mon Jan  9 03:40:05 2006
From: bolker at zoo.ufl.edu (Ben Bolker)
Date: Sun, 08 Jan 2006 21:40:05 -0500
Subject: [Rd] prod(numeric(0)) surprise
In-Reply-To: <43C1CBB9.7090307@stats.uwo.ca>
References: <43C1C973.8080702@zoo.ufl.edu> <43C1CBB9.7090307@stats.uwo.ca>
Message-ID: <43C1CD05.2030504@zoo.ufl.edu>

Duncan Murdoch wrote:
> On 1/8/2006 9:24 PM, Ben Bolker wrote:
> 
>>    It surprised me that prod(numeric(0)) is 1.
>> I guess if you say (operation(nothing) == identity
>> element) this makes sense, but ??
> 
> 
> What value were you expecting, or were you expecting an error?  I can't 
> think how any other value could be justified, and throwing an error 
> would make a lot of formulas more complicated.
> 
>>
> 
> 
> That's a fairly standard mathematical convention, which is presumably 
> why sum and prod work that way.
> 
> Duncan Murdoch

   OK.  I guess I was expecting NaN/NA (as opposed to an error),
but I take the "this makes everything else more complicated" point.
Should this be documented or is it just too obvious ... ?
(Funny -- I'm willing to take gamma(1)==1 without any argument
or suggestion that it should be documented ...)


   cheers
     Ben


-- 
620B Bartram Hall                            bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704



[Rd] prod(numeric(0)) surprise
Ben Bolker