summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorNami-Doc <vendethiel@hotmail.fr>2014-08-06 22:54:09 +0200
committerNami-Doc <vendethiel@hotmail.fr>2014-08-06 22:54:09 +0200
commit03e1da713c71466f0a53b8631afa8cb2403552e7 (patch)
treecedbb3d549ea8f810ab720b09f1c56ba6b89dc6e /python.html.markdown
parent4349587ac4de7bc3436f68415bcf5bdfac260e5e (diff)
parentcb3217fc35f3097c4be5b39fb36bd74b5e415f6c (diff)
Merge pull request #709 from NadOby/master
example of negative integer division
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown4
1 files changed, 3 insertions, 1 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 73963a3c..9057dde2 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -45,9 +45,11 @@ to Python 2.x. Look for another tour of Python 3 soon!
2.0 # This is a float
11.0 / 4.0 # => 2.75 ahhh...much better
-# Truncation or Integer division
+# Result of integer division truncated down both for positive and negative.
5 // 3 # => 1
5.0 // 3.0 # => 1.0 # works on floats too
+-5 // 3 # => -2
+-5.0 // 3.0 # => -2.0
# Modulo operation
7 % 3 # => 1