Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic equality operator #5

Open
MasonProtter opened this issue Oct 2, 2018 · 1 comment
Open

Symbolic equality operator #5

MasonProtter opened this issue Oct 2, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@MasonProtter
Copy link
Owner

MasonProtter commented Oct 2, 2018

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?

@MasonProtter MasonProtter added the enhancement New feature or request label Oct 2, 2018
@PerezHz
Copy link
Contributor

PerezHz commented Oct 3, 2018

Perhaps we should just follow behavior of == as it is used in scmutils, where if I remember correctly the equivalent of x*y == y*x gives false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants