#10112: random_prime does not handle erroneous input gracefully - it hangs
-------------------------------------------+--------------------------------
Reporter: drkirkby | Owner: was
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7
Component: number theory | Keywords:
Author: Mike Hansen, Francis Clarke | Upstream: N/A
Reviewer: David Kirkby | Merged:
Work_issues: |
-------------------------------------------+--------------------------------
Changes (by drkirkby):
* status: needs_work => needs_review
Comment:
Is there any reason this should not be changed to positive review if the
slowdown is very small?
Unless there's universal agreement on this, I suggest the changes in
documentation, are put on #10111. That ticket was supposed to address the
deficiencies in the documentation. The only comment on that ticket is from
Mike, and is ''See the patch at #10112.'' But if Mikes patch here, which
changes both the documentation and the code is going to stall, we might as
well just fix the documentation for now on #10111. The changes needed to
the documentation appear to be
* The example {{{random_prime(200, lbound=100)}}} is added
* The example {{{random_prime(200, proof=False, lbound=100)}}} is added.
* The error message in the code (which I guess is code not
documentation), which changes ''n must be greater than lbound'' to ''n
must be at least lbound''. Clearly looking at the code, fwclarke's change
is correct, since the test before the error message is {{{if n <
lbound}}}. Therefore n=lbound is permitted by the code, so the correct
error message should be ''n must be at least lbound''
If there is no agreement to merge the two patches here, I'll create one
patch which just fixes the above 3 documentation problems and add that to
#10111. Does that make sense?
Dave
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10112#comment:14>
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.