Opened 8 years ago

Closed 8 years ago

#13894 closed defect (fixed)

Fix ArithmeticError: 0^0 in rings/finite_rings/integer_mod.pyx

Reported by: mjo Owned by: AlexGhitza
Priority: major Milestone: sage-5.8
Component: algebra Keywords:
Cc: Merged in: sage-5.8.beta1
Authors: Michael Orlitzky, Jean-Pierre Flori Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mjo)

The few remaining instances of this error are tracked at #13786. In this case,

sage: R = Integers(100)
sage: R(0)^0
...
ArithmeticError: 0^0 is undefined.

APPLY

  • sage-trac_13894.patch

Attachments (1)

sage-trac_13894.patch (5.2 KB) - added by mjo 8 years ago.
Updated patch with jpflori's fix and a new doctest

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by mjo

  • Authors set to Michael Orlitzky
  • Status changed from new to needs_review

comment:2 Changed 8 years ago by jpflori

  • Status changed from needs_review to needs_work
  • Work issues set to fix Integers(1)

This will fail if the modulus is 1 as we are looking for a precomputed value at index 1 (python numbering) in a table of length modulus = 1... Ok, Integers(1) is not the more interesting ring, but...

comment:3 Changed 8 years ago by jpflori

  • Authors changed from Michael Orlitzky to Michael Orlitzky, Jean-Pierre Flori
  • Description modified (diff)
  • Status changed from needs_work to needs_review
  • Work issues fix Integers(1) deleted

Maybe we should add a doctest for the cornercase?

Changed 8 years ago by mjo

Updated patch with jpflori's fix and a new doctest

comment:4 Changed 8 years ago by mjo

  • Description modified (diff)

Thanks, I added doctests for the mod-1 case. I also put double backticks around 0^0 per tscrim's comment in #13786.

comment:5 Changed 8 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

Looks good to me. Thanks.

comment:6 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.8.beta1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.