Hi Leif,

On 24 Sep., 16:28, leif <not.rea...@online.de> wrote:
> A smarter compiler would [have] remove[d] *the whole loop*, since the
> loop body is completely dead code (for 2/3 rather than 2.0/3, because
> abs(...)<0 will never hold).

Since we talk about a spyx-file (not pyx), the Sage preparser is
applied to 2/3, if I am not mistaken. Hence, 2/3 is not 0 but the
rational number 2/3. However, since the left hand side is a double,
the comparison is faster if the right hand side is a double as well.

And even if 2/3 was 0, would the compiler really know that the
function "abs" can not return a negative number?

>     for root in []: ...
>
> does *not* change the (previous) value of 'root'. (In fact, the
> construct above doesn't define 'root' at all.)

That's part of my additions to the code: It helps a lot if the
compiler knows that 'root' is a ComplexDoubleElement.

Best regards,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to