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: |

### Description (last modified by )

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 13000.2.patch.

### Attachments (1)

### Change History (7)

### comment:1 Changed 10 years ago by

Status: | new → needs_review |
---|

### comment:2 Changed 10 years ago by

### comment:4 Changed 10 years ago by

Description: | modified (diff) |
---|---|

Reviewers: | → Keshav Kini |

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

### comment:5 Changed 10 years ago by

Description: | modified (diff) |
---|---|

Status: | needs_review → positive_review |

I added a commit message.

### comment:6 Changed 10 years ago by

Merged in: | → sage-5.1.beta3 |
---|---|

Resolution: | → fixed |

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

Cool, I'll review this after dinner :)