Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isa(x,Number) #82

Closed
sswatson opened this issue Apr 19, 2017 · 2 comments
Closed

isa(x,Number) #82

sswatson opened this issue Apr 19, 2017 · 2 comments

Comments

@sswatson
Copy link

It seems undesirable that a variable of type SymEngine.Basic is a Number but throws an error when coerced to that type. The type SymPy.Sym does not have this issue.

julia> using SymEngine
julia> @vars x
julia> isa(x,Number)
true
julia> Number[1,2,3,x]
ERROR: ArgumentError: Object can have no free symbols
 in N(::SymEngine.BasicType{Val{:Symbol}}) at /Users/sswatson/.julia/v0.5/SymEngine/src/numerics.jl:122
 in setindex!(::Array{Number,1}, ::SymEngine.Basic, ::Int64) at ./array.jl:415
 in getindex(::Type{Number}, ::Int64, ::Int64, ::Int64, ::SymEngine.Basic, ::Vararg{SymEngine.Basic,N}) at ./array.jl:132
julia> using SymPy; @syms y
(y,)

julia> Number[1,2,3,y]
4-element Array{Number,1}:
 1
 2
 3
 y
@ChrisRackauckas
Copy link
Contributor

Yeah, that's peculiar. I never noticed this. It should definitely be allowed in an array of numbers.

@isuruf
Copy link
Member

isuruf commented Apr 21, 2017

Fix in #83. Added the example here as a testcase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants