Sun 2018-06-03 11:33:16 UTC, Simon King:
>
> For symbolics, "==" only does trivial checks and leaves the equality
> unevaluated otherwise, so that you need an explicit evaluation as a
> bool in order to force a non-trivial computation.
>
> Such as:
>
>   sage: (x+1)^2 == x^2+2*x+1
>   (x + 1)^2 == x^2 + 2*x + 1
>   sage: bool(_)
>   True

Actually, for symbolics, "==" always creates an equation,
and never tries to evaluate it!

A lot of confusion stems from the fact that what "==" does
depends on whether both sides are symbolic:

- if neither side is symbolic, it tests equality
- if either side is symbolic, it creates an equation

Once an equation has been created, to evaluate
whether the equation holds, one can use "bool".

Compare:

    sage: 0 == 1
    False
    sage: SR(0) == 1
    0 == 1
    sage: 0 == SR(1)
    0 == 1
    sage: SR(0) == SR(1)
    0 == 1

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to