Times
and Plus
have the same grammar, and so do Product
and Sum
. So is there a function doing multiplication that has the same grammar as Total
does then?
If yes, what is it? If no, why?
Now I learn from @AntonAntonov that there is less need to design a ListProduct
function. So this indicates that multiplication and addition cannot be treated on the same footing.
About "duplicate": I think not. Because my question is not aimed at finding how, but at why.
About "off-topic": I think it constructive to make some of the design "philosophy" behind clearer to facilitate deeper understanding.
prod = Apply[Times]
?prod[{1,2,3,4}]
--> 24. $\endgroup$Fold[Times]
, which can be faster thanApply[Times]
on packed arrays. AndTr[#, Times] &
. althoughTr
is slightly slower thanApply
. $\endgroup$