Skip to content

imag function for type Polynomial #584

Description

@kpobrien

Hi, is there a reason real and conj are defined for the type Polynomial but imag is not? If no reason not to, I can make a PR defining the analogous functions. As a MWE, the real, and conj calls work, but imag is not defined.

using Polynomials
p = Polynomial((6,3,3.0+1im))
real(p)
conj(p)
imag(p)
ERROR: MethodError: no method matching imag(::Polynomial{ComplexF64, :x})

Closest candidates are:
  imag(::Missing)
   @ Base missing.jl:101
  imag(::LinearAlgebra.UnitLowerTriangular)
   @ LinearAlgebra ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/triangular.jl:160
  imag(::LinearAlgebra.UnitUpperTriangular)
   @ LinearAlgebra ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/triangular.jl:161
  ...

Stacktrace:
 [1] top-level scope
   @ REPL[5]:1

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions