#13000: Creating integers with very large base
------------------------------------+---------------------------------------
       Reporter:  roed              |         Owner:  AlexGhitza     
           Type:  defect            |        Status:  positive_review
       Priority:  major             |     Milestone:  sage-5.1       
      Component:  basic arithmetic  |    Resolution:                 
       Keywords:                    |   Work issues:                 
Report Upstream:  N/A               |     Reviewers:  Keshav Kini    
        Authors:  David Roe         |     Merged in:                 
   Dependencies:                    |      Stopgaps:                 
------------------------------------+---------------------------------------
Changes (by kini):

  * status:  needs_review => positive_review


Old description:

> {{{
> sage: a=ZZ(randint(0,2^128-1)).digits(2^64)
> sage: a
> [1154963902035838039, 8176620537326016718]
> sage: ZZ(a,2^64)
> ---------------------------------------------------------------------------
> OverflowError                             Traceback (most recent call
> last)
>
> /opt/sage-5.1.beta0/devel/sage-main/<ipython console> in <module>()
>
> /opt/sage-5.1.beta0/local/lib/python2.7/site-
> packages/sage/structure/parent.so in
> sage.structure.parent.Parent.__call__ (sage/structure/parent.c:8027)()
>
> /opt/sage-5.1.beta0/local/lib/python2.7/site-
> packages/sage/structure/coerce_maps.so in
> sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args
> (sage/structure/coerce_maps.c:3796)()
>
> /opt/sage-5.1.beta0/local/lib/python2.7/site-
> packages/sage/structure/coerce_maps.so in
> sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args
> (sage/structure/coerce_maps.c:3665)()
>
> /opt/sage-5.1.beta0/local/lib/python2.7/site-
> packages/sage/rings/integer.so in sage.rings.integer.Integer.__init__
> (sage/rings/integer.c:6304)()
>
> OverflowError: Python int too large to convert to C long
> }}}

New description:

 {{{
 sage: a=ZZ(randint(0,2^128-1)).digits(2^64)
 sage: a
 [1154963902035838039, 8176620537326016718]
 sage: ZZ(a,2^64)
 ---------------------------------------------------------------------------
 OverflowError                             Traceback (most recent call
 last)

 /opt/sage-5.1.beta0/devel/sage-main/<ipython console> in <module>()

 /opt/sage-5.1.beta0/local/lib/python2.7/site-
 packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
 (sage/structure/parent.c:8027)()

 /opt/sage-5.1.beta0/local/lib/python2.7/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args
 (sage/structure/coerce_maps.c:3796)()

 /opt/sage-5.1.beta0/local/lib/python2.7/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args
 (sage/structure/coerce_maps.c:3665)()

 /opt/sage-5.1.beta0/local/lib/python2.7/site-
 packages/sage/rings/integer.so in sage.rings.integer.Integer.__init__
 (sage/rings/integer.c:6304)()

 OverflowError: Python int too large to convert to C long
 }}}

 ---

 Apply [attachment:13000.2.patch].

--

Comment:

 I added a commit message.

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

Reply via email to