top | item 40113368

(no title)

ochoseis | 1 year ago

FWIW that comparison would’ve been identical in Python 2, where to get floating point division in Python would’ve been:

>>> 1//2

discuss

order

roelschroeven|1 year ago

1//2 always resulted in an integer, even in Python 2, with or without "from __future__ import division". To get floating point division in Python 2, you had to convert at least on of the operands to float (much like in C or C++).

You can try it online at tio.run, they still have Python 2 among their available languages, as well as Python 3.