Skip to content

Allow inverse trig functions to all take complex input #16439

@kcrisman

Description

@kcrisman

Where by complex I mean complex Python type.

sage: arccos(1+2*i)
arccos(2*I + 1)
sage: arccos(CC(1,2))
1.14371774040242 - 1.52857091948100*I
sage: arccos(CDF(1,2))
1.1437177404 - 1.52857091948*I
sage: arccos(complex(1,2))
<snip>
TypeError: Unable to convert x (='(1+2j)') to real number.

Presumably there are others of this type. Related:


sage: arcsec(-0.992725195401)
NaN
sage: arcsec(float(-0.992725195401))
<snip>
    732         if parent is float:
    733             return math.acos(1/x)
--> 734         return (1/x).arccos()
    735 
    736     def _eval_numpy_(self, x):

AttributeError: 'complex' object has no attribute 'arccos'

but this may or may not be dealt with at #13246.

CC: @burcin

Component: symbolics

Author: Punarbasu Purkayastha

Branch/Commit: 7c4c725

Reviewer: Karl-Dieter Crisman, Ralf Stephan

Issue created by migration from https://trac.sagemath.org/ticket/16439

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions