leif wrote:
> Jori Mäntysalo wrote:
>> On Fri, 26 Aug 2016, leif wrote:
>>
>>> Hmmm, does Posets.BooleanLattice() care whether you pass an int or an
>>> Integer?  (I.e., does the return type of its methods change?)
>>
>> No:
>>
>> sage: P = Posets.BooleanLattice(3)
>> sage: Q = Posets.BooleanLattice(3r)
>> sage: P == Q
>> True
>> sage: P is Q
>> True
> 
> I rather meant e.g. type(P.cardinality()), but since 'P is Q' holds,
> they won't differ.
> 
> No idea...

For me, it /does/ make a difference (using Python vs. Sage literals):

$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 7.3, Release Date: 2016-08-04                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
sage: from sage.combinat.posets.poset_examples import Posets
sage: from sage.misc.functional import log
sage: P = Posets.BooleanLattice(3); n = P.cardinality(); s =
P._hasse_diagram.size()
sage: if 2*s > n*log(n, 2): print "True"
sage: from sage.combinat.posets.poset_examples import Posets
sage: from sage.misc.functional import log
sage: P = Posets.BooleanLattice(3r); n = P.cardinality(); s =
P._hasse_diagram.size()
sage: if 2r*s > n*log(n, 2r): print "True"
True
sage:


And it's caused by this:

sage: type(n*log(n, 2))
<type 'sage.rings.integer.Integer'>
sage: type(n*log(n, 2r))
<type 'sage.symbolic.expression.Expression'>


(FWIW, while .cardinality() returns Integer, ._hasse_diagram.size()
returns int, but that doesn't matter here.)


-leif


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to