Skip to content

Incorrect precedence of // in exponent when converting SymPy expression to Julia Expr #474

@rben01

Description

@rben01

When converting a SymPy symbolic expression to a Julia Expr, if there is an integer-division in an exponent, the integer division is placed into the output Expr without parentheses to indicate precedence, which is incorrect.

To reproduce:

julia> convert(Expr, 1/(2*x*sympy.pi^(1//4)))
:((1 / 2) * pi ^ -1//4 * x ^ -1)

Expected result:

:((1 / 2) * pi ^ (-1//4) * x ^ -1)

As is, the returned Expr is interpreted as :(((1 / 2) * pi ^ -1)//4 * x ^ -1), which is incorrect.

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