Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1738 closed defect (duplicate)

[with patch] fraction field __pow__ doesn't handle negative exp. elegantly

Reported by: jbmohler Owned by: was
Priority: major Milestone: sage-2.10
Component: algebraic geometry Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Negative exponents put fraction field elements in the denominator of a fraction field element.

sage: R.<x>=ZZ[]
sage: (1/x)^-3

With the patch:

sage: R.<x>=ZZ[]
sage: (1/x)^-3

Attachments (1)

fraction_field_pow.patch (1.9 KB) - added by jbmohler 13 years ago.

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by jbmohler

comment:1 Changed 13 years ago by was

It looks good to me except change the somewhat too verbose

  sage: x = PolynomialRing(RationalField(),'x').gen() 

to one of the following (take your pick):

  sage: x = polygen(QQ, 'x')


  sage: R.<x> = QQ[]


  sage: x = PolynomialRing(QQ,'x').gen()

I think it is important that the docstrings give illustrations of good usage of Sage.

comment:2 Changed 13 years ago by mhansen

  • Resolution set to duplicate
  • Status changed from new to closed

comment:3 Changed 13 years ago by mhansen

This is a duplicate of #1786. I didn't realize that this was indeed the issue when opening #1786.

Note: See TracTickets for help on using tickets.