Skip to content

Power with complex exponent fails #717

@karlwessel

Description

@karlwessel

Taking the power of a symbolic and a complex exponent fails:

julia> using SymbolicUtils

julia> @syms x
(x,)

julia> x^im
ERROR: MethodError: no method matching isless(::Complex{Bool}, ::Int64)
The function `isless` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  isless(::Missing, ::Any)
   @ Base missing.jl:87
  isless(::Any, ::Missing)
   @ Base missing.jl:88
  isless(::AbstractFloat, ::Real)
   @ Base operators.jl:180
  ...

Stacktrace:
 [1] <(x::Complex{Bool}, y::Int64)
   @ Base ./operators.jl:353
 [2] ^(a::SymbolicUtils.BasicSymbolic{Number}, b::Complex{Bool})
   @ SymbolicUtils ~/.julia/packages/SymbolicUtils/QUEf3/src/types.jl:1493
 [3] top-level scope
   @ REPL[5]:1

I'll submit a PR with a fix.

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