Hi Roland,

On 1 Mai, 12:08, Rolandb <rola...@planet.nl> wrote:
> sage: R.<A,B>=QQ[]
> sage: list((A^2+B).factor()+(B^2).factor())
> [(1, A^2), (1, B^2), (1, B)]
> sage: list((A^2+B).factor())+list((B^2).factor())
> [(A^2 + B, 1), (B, 2)]
>
> Is the first result what I could (should) expect?
> (tested via KAIST, version 4.6.1)

Both results are what you should expect.

sage: type((A^2+B).factor()+(B^2).factor())
<type
'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>

Hence, in your first example, you list a polynomial. The result is a
list of pairs (c,m), where c is a coefficient and m is a monomial.

sage: type((A^2+B).factor())
<class 'sage.structure.factorization.Factorization'>

Hence, in your second example, you concatenate two lists that are
obtained from two factorizations. When you list a factorisation, you
obtain a list of pairs (x,d), where x is a factor and d is the
exponent of that factor in the factorisation.

Best regards,
Simon

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

Reply via email to