Opened 15 months ago

Closed 8 months ago

#30304 closed defect (duplicate)

MemoryError when calling (2*pi)^QQ(n) for integers n > 1

Reported by: galipnik Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: symbolics Keywords:
Cc: behackl Merged in:
Authors: Reviewers: Dave Morris
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

When I call (2*pi)^QQ(n) for some integer n > 1, then I obtain

---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
<ipython-input-4-a458fbffeb47> in <module>()
----> 1 (Integer(2)*pi)**QQ(Integer(2))

../sage-8.9/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in __call__(self, result)
    248             self.fill_exec_result(result)
    249             if format_dict:
--> 250                 self.write_format_data(format_dict, md_dict)
    251                 self.log_output(format_dict)
    252             self.finish_displayhook()

../sage-8.9/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in write_format_data(self, format_dict, md_dict)
    187                 result_repr = '\n' + result_repr
    188 
--> 189         print(result_repr)
    190 
    191     def update_user_ns(self, result):

MemoryError: 

Some weird facts:

  • It works with non-interal powers, e.g., (2*pi)^(5/2).
  • pi^QQ(2) works as well.
  • Also expr = (2*pi)^QQ(2) and calculations like expr / expr work fine.

Same issue occurs with sage-9.0.

Change History (4)

comment:1 Changed 12 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:2 Changed 10 months ago by gh-DaveWitteMorris

  • Component changed from PLEASE CHANGE to symbolics
  • Milestone changed from sage-9.3 to sage-duplicate/invalid/wontfix
  • Reviewers set to Dave Morris
  • Status changed from new to needs_review

This can be closed as a duplicate of #30446. The pull request at #30786 adds the appropriate doctest.

comment:3 Changed 10 months ago by tscrim

  • Status changed from needs_review to positive_review

comment:4 Changed 8 months ago by chapoton

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.