Jori Mäntysalo wrote: > 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).
Apparently log() behaves differently depending on whether it is called with Sage Integers or Python ints. (Not sure whether the other integer literal also matters here.) (You should get the same in the Sage session when using 2r instead of 2, or Integer(2) instead of 2 in the Python file.) -leif > > * * * > > 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. > -- 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.