Opened 10 years ago

Closed 10 years ago

#13000 closed defect (fixed)

Creating integers with very large base

Reported by: David Roe Owned by: Alex Ghitza
Priority: major Milestone: sage-5.1
Component: basic arithmetic Keywords:
Cc: Merged in: sage-5.1.beta3
Authors: David Roe Reviewers: Keshav Kini
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Keshav Kini)

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/ in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:8027)()

/opt/sage-5.1.beta0/local/lib/python2.7/site-packages/sage/structure/ 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/ 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/ in sage.rings.integer.Integer.__init__ (sage/rings/integer.c:6304)()

OverflowError: Python int too large to convert to C long


Apply 13000.2.patch.

Attachments (1)

13000.2.patch (2.4 KB) - added by Keshav Kini 10 years ago.
apply to $SAGE_ROOT/devel/sage

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by David Roe

Status: newneeds_review

comment:2 Changed 10 years ago by Keshav Kini

Cool, I'll review this after dinner :)

comment:3 Changed 10 years ago by Keshav Kini

Fix the commit message! :)

comment:4 Changed 10 years ago by Keshav Kini

Description: modified (diff)
Reviewers: Keshav Kini

The error message in the description was miscopied by David, apparently

Changed 10 years ago by Keshav Kini

Attachment: 13000.2.patch added

apply to $SAGE_ROOT/devel/sage

comment:5 Changed 10 years ago by Keshav Kini

Description: modified (diff)
Status: needs_reviewpositive_review

I added a commit message.

comment:6 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.1.beta3
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.