#13516: prime_powers doesn't work with start very well
---------------------------------+------------------------------------------
Reporter: kcrisman | Owner: was
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.4
Component: number theory | Resolution:
Keywords: beginner | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Kevin Halasz | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by dimpase):
* status: needs_review => needs_work
Comment:
You always should coerce {{{stop}}} into Integer. Indeed, currently one
gets:
{{{
sage: prime_powers(1,int(9))
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/usr/local/src/sage/sage-5.4.rc0/devel/sage-main/<ipython console> in
<module>()
/usr/local/src/sage/sage-5.4.rc0/local/lib/python2.7/site-
packages/sage/rings/arith.pyc in prime_powers(start, stop)
761 from sage.rings.integer import is_Integer
762 if not (is_Integer(start) and (is_Integer(stop) or stop ==
None)):
--> 763 raise TypeError, "both inputs must be integers, but your
inputs were %s and %s"%(start,stop)
764
765 # deal with the case in which only one input is given
TypeError: both inputs must be integers, but your inputs were 1 and 9
}}}
This is because taking {{{sqrt(int(9))}}} does not work too well in
Sage...
Second issue: the comment {{{ # check that all inputs are positive
integers}}} on line 760 is misleading!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13516#comment:15>
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.