Ruby Inject Method Strange Output
<p>Trying out a simple tutorial on ruby. In IRB, when i type the following code</p>

<pre><code>(1..10).inject{|memo,n| memo + n} 
=&gt;55 (correct calculation)
</code></pre>

<p>However, when I type the following:</p>

<pre><code>(1..10).inject{|memo,n| memo + n*2} 
=&gt;109 (which should be 110)
</code></pre>

<p>The calculation becomes wrong. What seems to be the problem when Ruby is performing the inject method?</p>