Hi,

On 23 October 2011 17:45, smichr <[email protected]> wrote:

> I found that cancel (even when there is nothing to cancel) does do
> something:
>
>    >>> cancel(3.0*x+y**2-2)
>    3.0*x + 1.0*y**2 - 2.0
>
> I'm not sure if this is a bug or a feature, but it's something to be
> aware of.
>

This is a future, because the expression you cancel is converted to a
polynomial over real domain and when converted back to an expression,
Poly.as_expr() doesn't look for minimal representation of coefficients. Just
to note:

In [1]: 3.0*x + y**2 - 2.0
Out[1]:
         2
3.0⋅x + y  - 2.0

In [2]: cancel(_)
Out[2]:
             2
3.0⋅x + 1.0⋅y  - 2.0

In [3]: 1.0*y**2
Out[3]:
     2
1.0⋅y

So, this is a natural thing in SymPy.


>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>
>
Mateusz

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to