Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

.simplify() and .tex() not working together with fraction #18

@trkern

Description

@trkern

Combining .simplify() and .tex() seems to drop a coefficient in the numerator:

KAS.parse("3*x/2").expr.simplify().tex()
"\frac{x}{2}"

But, using either .simplify() or .tex() on their own works correctly:

KAS.parse("3x/2").expr.simplify().print()
"3/2
x"
KAS.parse("3*x/2").expr.tex()
"\frac{3x}{2}"

To get started on figuring out what's happening, it seems that KAS.parse("3/2x").expr and KAS.parse("3/2x").expr.simplify() are identical, except KAS.parse("3/2x").expr.terms[0].hints.fraction is true while KAS.parse("3/2x").expr.simplify().terms[0].hints.fraction is false.

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