Skip to content

Square roots are simplified to decimals #3110

@omelancon

Description

@omelancon

The function simplify always evaluates sqrt instead of leaving some forms such as sqrt(2) unchanged.

To Reproduce

Simplify the following:

math.simplify('sqrt(2)')

The result is a ConstantNode with value 1.4142135623730951, but I expected a FunctionNode where the sqrt function was not applied.

When its argument is an exact, it feels like sqrt should only simplify to a constant if the result is an exact integer. This would be akin to divide that simplifies fractions, but does not apply division if the result is not an integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions