Can an algorithm for this be done in one line? : <p>I have 3 variables: <code>total</code>, <code>paid</code>, and <code>payment</code></p>

<p>Lets give an example to simplify the problem:</p>

<blockquote>
<pre><code>total = 100
paid = 10
</code></pre>
  
  <p>If a new <code>payment</code> comes in which value is <code>200</code>, <code>paid</code> should now
  become <code>100</code> <br> If a new <code>payment</code> comes in which value is <code>50</code>,
  <code>paid</code> should now become <code>60</code> <br> If a new <code>payment</code> comes in which
  value is <code>90</code>, <code>paid</code> should now become <code>100</code></p>
</blockquote>

<p>I think you get what im going for.</p>

<p>Can <code>paid</code> be calculated in one line, without using <code>if</code> or the <code>?</code> operator?</p>
