symengine / SymEngine.jl

Julia wrappers of SymEngine
MIT License
193 stars 43 forks source link

`imag()` and `reim()` gives `InexactError(::Symbol, ::Any, ::Any)` #273

Open xiaodong-hu opened 6 months ago

xiaodong-hu commented 6 months ago

Minimal Example:

using SymEngine

@vars x
real(x) # returns x, instead of keeping `real(x)`
imag(x) # gives `InexactError(::Symbol, ::Any, ::Any)`
reim(x) # gives `InexactError(::Symbol, ::Any, ::Any)`

I notice that by construction SymEngine.Basic <: Number but NOT subtype of Real or Complex. So I really do not understand the logic here: why real(x) simply gives x?

OK, even if the the symbol x is assumed to be real, then why is complex(x) not defined?