#8344: Factor constant polynomials over QQbar
--------------------------------+-------------------------------------------
   Reporter:  boothby           |       Owner:  AlexGhitza  
       Type:  defect            |      Status:  needs_review
   Priority:  critical          |   Milestone:  sage-4.3.4  
  Component:  basic arithmetic  |    Keywords:              
     Author:                    |    Upstream:  N/A         
   Reviewer:                    |      Merged:              
Work_issues:                    |  
--------------------------------+-------------------------------------------
Changes (by dimpase):

  * status:  needs_work => needs_review


Comment:

 Replying to [comment:3 cremona]:
 > I don't think this is right.
 > {{{
 >   if self.degree() == 0:
 >        return Factorization([(self,1)])
 > }}}
 > If R (the coefficient ring) is a field then we should return the
 factorization with no pairs (irreducible,exponent) but with unit=self.
 But if (for example) R is ZZ then we do need to factor constants, so
 returning self(0).factor() is about right.

 I don't understand your remark.
 My patch appears to be in accordance with the current design.

 sage: f = ZZ['x'](4*x)
 sage: f.squarefree_decomposition()
 (4) * x
 sage: f.factor()
 2^2 * x

 And it works:

 sage: f = ZZ['x'](4)
 sage: f.factor()
 2^2
 sage: f.squarefree_decomposition()
 4

 sage: f = QQbar['x'](4)
 sage: f.factor()
 4
 sage: f.squarefree_decomposition()
 4

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8344#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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/sage-trac?hl=en.

Reply via email to