You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the current way to just convert a number (and indeed, the number 0) into a symbolic that can be stored in a vector with other symbolic expressions? I tried (Symbolics.Term(Symbolics.identity, [Real(Float64(result))]) ) but this gives an error when I try to store it in an array, the error is
ERROR: LoadError: MethodError: Cannot `convert` an object of type
SymbolicUtils.BasicSymbolic{Float64} to an object of type
SymbolicUtils.BasicSymbolic{Real}
Following the discussion in
As of Symbolics v5.1.0 and SymbolicUtils v1.0.3, it is complicated to create a symbolic number that doesn't include a variable.
For example, to create a symbolic$\sqrt 3$ , one needs to call
Here, users have to be aware of the
Term
data structure, in which the fieldarguments
is aVector
instead of just a scalar number.Term
Term
And a
BasicSymbolic
shall bewrap
ped in aNum
in order to properly use promotion rules.Symbolics.jl/src/wrapper-types.jl
Lines 48 to 52 in 426eb80
Symbolics.jl/src/num.jl
Lines 1 to 3 in 426eb80
Symbolics.jl/src/num.jl
Lines 98 to 99 in 426eb80
We should hide these internal details to make it simpler for end users.
In SymPy and SymEngine, we can do it as follows, which are very straightforward.
The text was updated successfully, but these errors were encountered: