sage: def foo():
....:     from sage.combinat.posets.poset_examples import Posets
....:     from sage.misc.functional import log
....:     P = Posets.BooleanLattice(3); n = P.cardinality(); s = 
P._hasse_diagram.size()
....:     if 2*s > n*log(n, 2): print "True"
....:
sage: foo()
sage:

So, in this case the comparison is False. Now when I add exactly same function on end of lattices.py and compile I got

sage: sage.combinat.posets.lattices.foo()
True
sage:

What's wrong? Somehow comparison and logaritms don't mix (again).

 * * *

Is there a function to get 2-based logarithm of integer in Sage? In Python 3.3 there is, but we use Python 2.x.

--
Jori Mäntysalo

Reply via email to