[docs] Bug on http://docs.python.org/tutorial/introduction.html#numbers

Georg Brandl georg at python.org
Sat Dec 11 09:05:26 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 10.12.2010 09:28, schrieb Wonjohn Choi:
> 7/3 should result in the exact value.
> 7//3 will output a floor value.

Hi Wonjohn,

In Python 2.x, which is the version of the documentation you refer to, 7/3
does floor division; you have to use "from __future__ import division" to
activate the float division feature.

In Python 3.x, / always does. float division.

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iEYEARECAAYFAk0DMMUACgkQN9GcIYhpnLA6RwCeL80pQipuGUgbR/ZbtHLlyY+A
awUAoKPeflMlvcpccSA66JU77DEC9t7c
=m395
-----END PGP SIGNATURE-----


More information about the docs mailing list