On Fri, Oct 4, 2013 at 9:26 AM, Nathann Cohen <[email protected]> wrote: > Helloooooo everybody ! > > This is what I spent the last hour finding : > > sage: x = 1/2 > sage: x > 1/2 > sage: x//2 > 1/4 > > I got some variable x as input, which was of rational type when I > expected it to be integer type (does not matter, this rational was > equal to an integer in my case). Unfortunately, x//2 (which I > understand as the integer division of x by 2) does not return an > integer. > > Bug or feature ? :-P
*Bug*, because in pure Python, we have ~$ python Python 2.7.3 (default, Sep 26 2013, 20:03:06) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 0.5//2 0.0 >>> ~$ python3 Python 3.2.3 (default, Sep 25 2013, 18:22:43) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 0.5//2 0.0 > > Nathann > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" 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-support. > For more options, visit https://groups.google.com/groups/opt_out. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups "sage-support" 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-support. For more options, visit https://groups.google.com/groups/opt_out.
