#5140: [with patch, with review, needs work] is_irreducible() reports units as
irreducible
----------------------------+-----------------------------------------------
Reporter: lars.fischer | Owner: tbd
Type: defect | Status: new
Priority: minor | Milestone: sage-3.4.1
Component: algebra | Resolution:
Keywords: is_irreducible |
----------------------------+-----------------------------------------------
Changes (by cremona):
* priority: trivial => minor
* summary: [with patch, needs review] is_irreducible() reports units as
irreducible => [with patch, with review, needs
work] is_irreducible() reports units as
irreducible
Comment:
Review: I agree entirely that units need to be handled properly here, but
I do not think that this patch solves the issue.
Firstly, I don't think that raising an error is necessary or helpful, and
would prefer to return False for units.
Secondly, you have left in the code which (now for non-units) returns True
for degree 0 polynomials. But that is wrong for polynomials over rings
which are not fields such as ZZ[x], where 6 has degree 0, is not a unit
but is not irreducible. Instead, for degree 0 polynomials (which have
already been handled by the is_unit() test) one should test irreducibility
in the base ring.
Example:
{{{
sage: R.<x>=ZZ[]
sage: R(6).is_irreducible()
True
}}}
is wrong, and it would be nice if the patch handled this also.
Lastly: Lars, when you make a patch to correct some incorrect behaviour in
Sage you should add a doctest to the function which shows that the problem
has been solved.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5140#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---