On Sep 2, 8:19 am, "John Cremona" <[EMAIL PROTECTED]> wrote:
> Putting == between two symbol expressions creates a symbolic equation,
> not a test for equality. There is there fore a difference between
> these:
>
> sage: 3 == 3
> True
> sage: x == x
> x == x
In the same category as the latter:
sage: 3 == pi
3 == pi
sage: bool(3 == pi)
False
In your situation, 'bool(dSv==dSvq)' returns True. (bool is a
function which 'Returns True when the argument x is true, False
otherwise'.)
> This behaviour of == is (I think) unique to the symbolic ring in Sage.
> You can test for equality like this:
>
> sage: dSv-dSvq
> 0
> sage: (dSv-dSvq).is_zero()
> True
>
> though in more complicated examples the expessions might have to be
> simplified manually.
>
> In general in computer algebra, simplifying an expression which
> simplifies to 0 is easier than trying to find two simplifications of
> two expressions which appear to be the same.
>
> I'm sure there are computer algebra experts reading this who can
> explain it better.
>
> John
>
> 2008/9/2 Stan Schymanski <[EMAIL PROTECTED]>:
>
>
>
> > Dear all,
>
> > I must be doing something wrong here, but I don't know what. I'm sure
> > someone will see it straight away:
>
> > ----------------------------------------------------------------------
> > | SAGE Version 3.1.1, Release Date: 2008-08-17 |
> > | Type notebook() for the GUI, and license() for information. |
> > ----------------------------------------------------------------------
>
> > sage: var('myuv myub q qvb qbv')
> > (myuv, myub, q, qvb, qbv)
> > sage: dSv=myuv*qvb - myuv*qbv
> > sage: dSvq=myuv*qvb - myuv*qbv
> > sage: dsage: dSv-dSvq
> > myuv*qvb - myuv*qbv == myuv*qvb - myuv*qbv
>
> > Why does SAGE not return 'true'?
>
> > Just pointing me to the right page in the docu would help, too! Thanks
> > already.
>
> > Stan
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---