JuliaPy / SymPy.jl

Julia interface to SymPy via PyCall
http://juliapy.github.io/SymPy.jl/
MIT License
268 stars 62 forks source link

sqrt(3) gives floating-point value instead of symbolic expression #493

Closed ketch closed 1 year ago

ketch commented 1 year ago

In Python:

Screen Shot 2023-02-23 at 9 22 42 AM

In Julia:

Screen Shot 2023-02-23 at 9 23 25 AM
jverzani commented 1 year ago

Yeah, that is expected. SymPy.sqrt simply extends the base sqrt function for the Sym type (and friends). The method for Int remains unchanged, as you see. To get a symbolic value, you have sqrt(Sym(3)) or sqrt(sympify(3)) among other variants.

ketch commented 1 year ago

Thank you!