Skip to content

Symbolic equality operator #5

Description

@MasonProtter

Right now, == is used to tell if two symbolic expressions are the same. Ie.

using Symbolics
@sym x y

julia> x*y == y*x
false

julia> cos(x)^2 + sin(x)^2 == 1
false

and in some senses, I kind of like it being that way because that's more the sense that == is used elsewhere with Julia. I definitely think its a good idea for == to always return a boolean. That approach seems to preclude using == the way its used for instance in Mathematica where

In[1]:= x == 1

Out[1]= x == 1

In[2]:= Cos[x]^2 + Sin[x]^2 == 1 // FullSimplify

Out[2]= True

I think it may be preferable to use an operator like (\cong) to denote the mathematical relation. With this syntax, we'd have

julia> x  1
x  1

julia> cos(x)^2 + sin(x)^2  1
true

Any thoughts or feelings @PerezHz?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions