#18159: cardinality must output Infinty or a Sage integer
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: new
Priority: critical | Milestone: sage-6.6
Component: categories | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/18159 | 17924b8da8777805ca17289e00e62c3beca5a146
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Replying to [comment:5 ncohen]:
> I do not understand. It seems that your code detects it as 'wrong' if a
function `.cardinality()` returns `int(4)`. Why is that?
Yes. And the reason is because Python int do not behave as Sage integers.
For example
{{{
sage: S = my_finite_set()
sage: S.cardinality().factor()
sage: ~(S.cardinality())
}}}
For coherence, we need to have some specifications for `.cardinality`.
The main reason for that ticket was that some sets were actually returning
rational numbers see http://trac.sagemath.org/ticket/17852#comment:92
--
Ticket URL: <http://trac.sagemath.org/ticket/18159#comment:7>
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.