-
Notifications
You must be signed in to change notification settings - Fork 43
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
Problem with subs and powers #194
Comments
@vars z
subs(z^3+z^2+z,z,cbrt(Basic(3))) |
Thank you very much for your quick reply ! This yields
would return |
Ah, thanks. That looks like a bug. I would expect, |
If you don't bother to use some tooling such as https://github.com/dfdx/Espresso.jl, julia> using SymEngine, Espresso
julia> @vars z
(z,)
julia> poly = z^3+z^2+z
z + z^2 + z^3
julia> Espresso.subs(convert(Expr, poly), Dict(:(z^3)=>3))
:(z + z ^ 2 + 3)
julia> eval(ans)
3 + z + z^2
julia> typeof(ans)
Basic |
It is a nice idea to go through Julia AST ! I had not thought about it. Thank you very much ! |
Hello,
I currently encounter a problem using the
subs
function. When I run the following code,I get
3 + z + 3^(2/3)
instead of either3 + 3^(2/3) + 3^(1/3)
or3 + z^2 + z
. Is there any trick to get the latter as output ?Thanks in advance,
The text was updated successfully, but these errors were encountered: