#17717: Failure to reduce int modulo large prime
-------------------------------------+-------------------------------------
       Reporter:  xander.faber       |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.5
      Component:  finite rings       |   Resolution:
       Keywords:  modular            |    Merged in:
  arithmetic                         |    Reviewers:
        Authors:  Xander Faber       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  216a263607d80e0f399c6832df4943757026b6bd
  u/xander.faber/integer_mod_fix     |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Yes, those are indeed the other way around. I think the more consistent
 solution (at least with `set_from_mpz` above it) is
 {{{#!python
 if value < 0 or mpz_cmp_si(value, self.__modulus.sageInteger.value) >= 0
 }}}
 and then if you could also add a doctest to that method
 {{{
 """
 EXAMPLES::

     sage: p = next_prime(2^32)
     sage: GF(p)(int(p+1))
     1
 """
 }}}
 Thanks.

--
Ticket URL: <http://trac.sagemath.org/ticket/17717#comment:6>
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