> ...
>                     si = numpy.sign(xm-xf) + ((xm-xf)==0)
> ...
>         si = numpy.sign(rat) + (rat == 0)
>         x = xf + si*max([abs(rat), tol1])
> ...

Ah shoot. That code is quite understandable. What they need is:

....
        si = numpy.sign(xm-xf)
        if si == 0:
            si = 1
...
    si = numpy.sign(rat)
    if si == 0:
       si = 1
    x = xf + si*max([abs(rat), tol1])
...

Their assumption that numpy.sign(rat) == 0 iff (rat == 0) evaluates to
1 and that (rat == 0) evaluates to 0 otherwise is not unreasonable in
their world. The above code is of course a little more robust, but I
doubt scipy is willing to change it just because sage's SR acts funny.
So the fix: sage should interface a little more carefully with scipy
and take care no SR objects leak into it.

-- 
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