Conditional expressions in sagemath, when defining a symbolic expression
<p>In sagemath, (version 4.7) I do this, in the notebook:</p>

<pre><code>var("x y")
dens(x,y) = 2 if y &lt;= x else 0
</code></pre>

<p>and this give no errors. However, when typing</p>

<pre><code>dens(1,1)   returns 0

dens(1,0.5) returns 0   !
</code></pre>

<p>and so on. In fact, I found no way to get the answer 2.</p>

<p>What am I doing wrong?</p>
