JuliaMath / JuliaMath/Polynomials.jl

imag function for type Polynomial

Open
#584 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
320
Forks
80
Avg merge
8h 46m
Merged PRs (30d)
3

Description

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.

```julia
using Polynomials
p = Polynomial((6,3,3.0+1im))
real(p)
conj(p)
imag(p)
```
```julia
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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.