On Wed, 4 Jun 2008 08:08:22 -0700 (PDT)
Josh <[EMAIL PROTECTED]> wrote:

> 
> This doesn't quite work.  For some reason, while
> 
> x/y in set([(2*x)/(2*y)])
> 
> returns True,
> 
> x/y in set([(-2*x)/(-2*y)])
> 
> returns False!  Is there another work-around?

-1 is a unit in ZZ, so gcd(-2*x,-2*y)=2, and the canonical form of
(-2*x)/(-2*y) in our fraction field implementation is (-x)/(-y), hence
your problem.

I can't think of a way to make Sage handle this properly right now. In
your code, you can try to ensure that the leading coefficient of the
denominator is always positive. You won't run into this problem in that
case.

I will be traveling for the next couple of days, I'm sorry but I can't
be of much help to you.

Cheers,

Burcin

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to