Lisp has a variety of equality testing predicates.
EQ  for  " same memory location"
=   for "numeric equality"
There's also EQL, EQUAL, CHAR=, STRING=. ...  
One of the benefits of NOT having infix syntax for relations like "="  is 
that
it puts these others on a more equal footing, language-wise.

I suppose you might argue that "types" solve this problem, but you
would be wrong.  It is perfectly possible to want to know if two strings
that are string=   are also eq -- that is, in the same memory location.



RJF


On Thursday, October 2, 2014 6:02:10 AM UTC-7, Christophe Bal wrote:
>
> Hello.
>
> For me the fact that  1/3 == S(1)/3  has value  True  sounds like a bug 
> because  1/3  is a float, and  S(1)/3  a rational.
>
> Christophe BAL
>
> === PYTHON ===
>
> from sympy import *
>
> a = 1/3
> b = S(1)/3
>
> print(a)
> print(b)
>
> print(a == b)
> print(type(a))
> print(type(b))
>
> --- OUTPUT ---
>
> 0.3333333333333333
> 1/3
> True
> <class 'float'>
> <class 'sympy.core.numbers.Rational'>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/0dac566d-9a53-4388-8c16-937269370c1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to