Hi,

On Sun, 1 Nov 2009 03:54:05 -0800 (PST)
Vincent Delecroix <20100.delecr...@gmail.com> wrote:

> I agree that sqrt(2) > 1 ;)  the problem is the one Jason has
> developed : the comparison returns a symbolic expression !
> 
> Morever, It works well for min and max functions :
> {{{
> sage: max(sqrt(2), 1)
> sqrt(2)
> sage: min(sqrt(2), 1)
> 1
> }}}

I am not sure if it's a coincidence that you get the right answer. I
guess max() uses __richcmp__ and not __cmp__. The implementation of
__richcmp__ for symbolic expressions creates symbolic relations,
whereas __cmp__ calls an internal comparison function in pynac.

sage: cmp(sqrt(2),SR(1))
1
sage: cmp(sqrt(2),SR(2))
1


> Why max(sqrt(2), 1) not a symbolic expression ?

There is a ticket to provide symbolic max and min functions here:

http://trac.sagemath.org/sage_trac/ticket/6949


Cheers,
Burcin

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to