#4425: [with patch, positive review] sqrt(4) returns a SymbolicComposition
instead
of the number 2!
------------------------------+---------------------------------------------
Reporter: was | Owner: kcrisman
Type: defect | Status: new
Priority: major | Milestone: sage-3.2
Component: basic arithmetic | Resolution:
Keywords: |
------------------------------+---------------------------------------------
Comment (by kcrisman):
Replying to [comment:5 was]:
> I attached a trivial followup patch to sqrt-nonsymbolic-1.patch which
adds a docstring for the _do_sqrt function (which had no docstring) and
some doctests to that function. The new docstring also clarifies that the
extend option to _do_sqrt is completely ignored, and why that is the right
behavior.
This seems okay; I didn't have time to merge it but the new tests behave
correctly. So this means that the following is the desired behavior for
when to extend and when not to extend?
{{{
sage: sqrt._do_sqrt(Integer(3),extend=False)
sqrt(3)
sage: a=3; type(a)
<type 'sage.rings.integer.Integer'>
sage: a.sqrt(extend=False)
---------------------------------------------------------------------------
ValueError: square root of 3 not an integer
}}}
If so, then let's finally let the square root of 4 be 2!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4425#comment:6>
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
-~----------~----~----~----~------~----~------~--~---