<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 11/02/2020 à 02:37, Federico Miyara
      a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <br>
      <font face="Courier New">Thanks, Samuel.<br>
        <br>
        This certainly clarifies how [] behaves. But is there a
        rationale for sum([])==0 and yet cumsum([])==[]?<br>
      </font></blockquote>
    <p>For sum([])==0 : <br>
      IMO this is OK. Personnaly, i expect from<br>
      sum(A) + sum(B) + .. sum(Z) not to be killed just because one of
      the arguments is []. So, to me, this case is somewhat distinct
      from the  A +[]. A + [] works element-wise.<br>
      Because a vector is expected from <tt>sum([],"r")</tt>, that then
      would be added in an element-wise way, <br>
      <font size="-1"><tt>--> sum([],"r")</tt><tt><br>
        </tt><tt> ans  =</tt><tt><br>
        </tt><tt>    []</tt></font><tt><br>
      </tt>is also OK.</p>
    <p>I would give the same rationale for prod([])==1.<font
        face="Courier New"><br>
      </font><br>
    </p>
    <blockquote type="cite"
      cite="mid:4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar"><font
        face="Courier New"> By the way, it would be useful to include
        cumsum and cumprod among the examples,</font></blockquote>
    <p>Right<br>
      <br>
      Regards<br>
      Samuel<br>
    </p>
    <br>
  </body>
</html>