On Tue, Oct 20, 2015 at 1:55 PM, Liu Yue <[email protected]> wrote: > I'm using sage 6.8. > > After I typed: RealSet(pi,pi+1), the answer I got is: (pi+1, pi). > > Furthermore: RealSet(pi,pi+1).lower() returns pi+1; RealSet(pi,pi+1).upper() > returns pi. > > Is there anything wrong?
I don't know. The ? help for RealSet it epically horrible. Why is this so utterly broken? (see [1] below). Using ?? to see the source code and reading it shows that (1) there is definitely a serious bug, which you're hitting, and (2) it can be traced to this even more serious bug: sage: RLF(pi+1) < RLF(pi) True # umh, no! sage: RLF Real Lazy Field Looking at blame [2], it looks like Robert Bradshaw originally wrote Real Lazy Field in 2008, but then Travis Scrimshaw and Jeroen Demeyer rewrote the comparison code recently. William NOTES: [2] https://github.com/sagemath/sage/blame/master/src/sage/rings/real_lazy.pyx [1] sage: RealSet? String form: <class 'sage.sets.real_set.RealSet'> File: /projects/sage/sage-6.9/src/sage/misc/lazy_import.pyx Docstring: EXAMPLES: sage: from sage.misc.lazy_import import LazyImport sage: my_isprime = LazyImport('sage.all', 'is_prime') sage: my_isprime(5) True sage: my_isprime(55) False Class docstring: EXAMPLES: sage: from sage.misc.lazy_import import LazyImport sage: my_integer = LazyImport('sage.rings.all', 'Integer') sage: my_integer(4) 4 sage: my_integer('101', base=2) 5 sage: my_integer(3/2) Traceback (most recent call last): ... TypeError: no conversion of this rational to integer Init docstring: EXAMPLES: sage: from sage.misc.lazy_import import LazyImport sage: my_isprime = LazyImport('sage.all', 'is_prime') sage: my_isprime(5) True sage: my_isprime(55) False Call docstring: Calling self calls the wrapped object. EXAMPLES: sage: from sage.misc.lazy_import import LazyImport sage: my_isprime = LazyImport('sage.all', 'is_prime') sage: my_isprime(12) False sage: my_isprime(13) True -- You received this message because you are subscribed to the Google Groups "sage-support" 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/sage-support. For more options, visit https://groups.google.com/d/optout.
