Ticket #1174 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[with patch, with positive review] very minor bug in calculs _complex_ coercion.

Reported by: was Owned by: was
Priority: major Milestone: sage-2.8.15
Component: calculus Keywords:
Cc: Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

Description (last modified by robertwb) (diff)

Still broken (or perhaps something deeper)

sage: complex(cos(3))
------------------------------------------------------------
Traceback (most recent call last):
  File "<ipython console>", line 1, in <module>
  File "/Users/robert/sage/current/local/lib/python2.5/site-packages/sage/calculus/calculus.py", line 3908, in __complex__
    return complex(f._approx_(complex(g)))
<type 'exceptions.TypeError'>: can't convert complex to float; use abs(z)

Attachments

7349.patch Download (1.0 KB) - added by was 2 years ago.
trac-1174-part2.patch Download (3.5 KB) - added by was 2 years ago.
apply this after applying the other patch
trac-1174-part3.patch Download (0.8 KB) - added by was 2 years ago.

Change History

Changed 2 years ago by was

Changed 2 years ago by was

I noticed this very slight mistake recently...

Changed 2 years ago by AlexGhitza

  • summary changed from very minor bug in calculs _complex_ coercion. to [with patch] very minor bug in calculs _complex_ coercion.

Changed 2 years ago by robertwb

I approve.

Changed 2 years ago by robertwb

But there should be a doctest.

Changed 2 years ago by robertwb

  • description modified (diff)

Changed 2 years ago by robertwb

  • summary changed from [with patch] very minor bug in calculs _complex_ coercion. to [with patch, with review] very minor bug in calculs _complex_ coercion.

The patch is good, the problem is that none of the python functions (e.g. sqrt, sin) handle complex values.

Changed 2 years ago by was

apply this after applying the other patch

Changed 2 years ago by was

  • summary changed from [with patch, with review] very minor bug in calculs _complex_ coercion. to [with patch, needs another review] very minor bug in calculs _complex_ coercion.

Changed 2 years ago by was

Changed 2 years ago by cwitty

  • summary changed from [with patch, needs another review] very minor bug in calculs _complex_ coercion. to [with patch, with positive review] very minor bug in calculs _complex_ coercion.

Looks good to me; doctests pass in sage/calculus and sage/rings. (Apply all three patches, in order.)

Changed 2 years ago by mabshoff

  • status changed from new to closed
  • resolution set to fixed

Merged in 2.8.15.rc0.

Note: See TracTickets for help on using tickets.