#9652: Unnecesary and buggy code in arith.py
------------------------+---------------------------------------------------
Reporter: mderickx | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: minor | Milestone:
Component: algebra | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Comment(by mderickx):
Ok so the code behaves buggy for valuation(1r,1r). I really think we
should just let sage integers handle it. I really don't like having
unneccery double code. Especially if one of the two is buggy.
By the way, the problem with valuation(0r,0r) is not just a problem of
this code, it also happes with valuation on sage ints. Should we report
that as a bug?
{{{
sage: 0.valuation(0)
+Infinity
sage: 8.valuation(0)
ValueError Traceback (most recent call
last)
...
ValueError: You can only compute the valuation with respect to a integer
larger than 1.
}}}
ps. if you want a number to not be converted to a sage integer by the
preparser you should just put an r behind the number. Or else the
preparser will generate the following silly code:
{{{
sage: preparse("valuation(int(1),int(1)")
'valuation(int(Integer(1)),int(Integer(1))'
}}}
What you want is this:
{{{
sage: preparse("valuation(1r,1r)")
'valuation(1,1)'
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9652#comment:8>
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.