On Wed, Sep 8, 2010 at 4:35 PM, mda_ <donmorri...@gmail.com> wrote: > The "not" coerces 0 into True, thereby keeping it in the list > comprehension. Should I file a bug?
According to the documentation for is_triangular_number, you should use the following test if you want to consider 0 triangular: sage: [x for x in [0..3] if is_triangular_number(x) is not False] [0, 1, 3] sage: [x for x in [0..3] if is_triangular_number(x) is False] [2] --Mike -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org