Skip to content
Prev 274957 / 398502 Next

Strange R behavior for product of two sum of integers

On Oct 20, 2011, at 1:45 AM, Lei Jiang wrote:

            
That does seem to be an infelicity that ought to be fixed. Using the  
infix addition operator does that same sort of coercions, so why would  
one expect the infix multiplication operator to refuse to do it?

 > (sum(1000:1205))*(sum(1000:1204) +1205)
[1] 51581223225

 >  (sum(1000:1205))*(sum(1000:1204) +0)
[1] 51307549650