#9903: is_prime should document proof flag
-------------------------------------+-------------------------------------
       Reporter:  dmharvey           |        Owner:  mvngu
           Type:  defect             |       Status:  needs_review
       Priority:  minor              |    Milestone:
      Component:  documentation      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Marc Mezzarobba    |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/mmezzarobba/9903-is_prime        |  9429cb66cd20ad1ae54b164ade479f1bd2b989c2
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Hello,

 Note that there was already an example at the end of `Integer.is_prime`:
 {{{
 sage: proof.arithmetic()
 True
 sage: n = 10^100 + 267
 sage: timeit("n.is_prime()")  # not tested
 5 loops, best of 3: 163 ms per loop
 sage: proof.arithmetic(False)
 sage: proof.arithmetic()
 False
 sage: timeit("n.is_prime()")  # not tested
 1000 loops, best of 3: 573 us per loop
 }}}
 What about a similar one in `arith.is_prime`
 {{{
 sage: a = 2**2048 + 981
 sage: is_prime(a)    # not tested - takes ~ 1min
 sage: proof.arithmetic(False)
 sage: is_prime(a)    # instantaneous!
 True
 sage: proof.arithmetic(True)
 }}}

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/9903#comment:2>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to