#17984: Dedicated RR.__contains__() and CC.__contains__()
-------------------------+-------------------------------------------------
Reporter: rws | Owner:
Type: | Status: needs_review
enhancement | Milestone: sage-6.6
Priority: major | Resolution:
Component: basic | Merged in:
arithmetic | Reviewers:
Keywords: | Work issues:
Authors: Ralf | Commit:
Stephan | 544450ea18ed2778953141bab8feced61237556e
Report Upstream: N/A | Stopgaps:
Branch: |
u/rws/17984 |
Dependencies: |
-------------------------+-------------------------------------------------
Old description:
> In the catch-all `structure/parent.pyx:Parent.__contains__` we depend on
> a bug to get the right result for, e.g. `sqrt(3) in RR/CC` despite
> `bool(RR/CC(sqrt(3))==sqrt(3))` being `False`(See comment 28 of #12967).
> In order to fix the bug fix (in a separate ticket) dedicated
> `__contains__` methods for both rings are needed.
>
> Moreover, until now Maxima is used for this which is slow and completely
> unnecessary.
New description:
In the catch-all `structure/parent.pyx:Parent.__contains__` we depend on
the construction `bool(item==self(item))` to get the right result for,
e.g. `sqrt(3) in RR/CC` but `bool(RR/CC(sqrt(3))==sqrt(3))` being `False`.
In order to make it more reliable dedicated `__contains__` methods for
both rings are needed.
Moreover, until now Maxima is used for this which is slow and completely
unnecessary.
--
Comment (by rws):
Replying to [comment:8 rws]:
> Replying to [comment:3 jdemeyer]:
> > Replying to [ticket:17984 rws]:
> > > In the catch-all `structure/parent.pyx:Parent.__contains__` we
depend on a bug to get the right result for, e.g. `sqrt(3) in RR/CC`
> >
> > Can you clarify this please?
>
> See comment 28 of #12967.
Ah, seems I was chasing ghosts there. Nevertheless the ticket makes sense
because of the unreliability of the construction `bool(item==self(item))`
for determining elementship.
--
Ticket URL: <http://trac.sagemath.org/ticket/17984#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.