diff options
author | Evgeniy Ginzburg <Nad.Oby@gmail.com> | 2014-08-06 23:43:37 +0300 |
---|---|---|
committer | Evgeniy Ginzburg <Nad.Oby@gmail.com> | 2014-08-06 23:43:37 +0300 |
commit | daf83c91232a259eee4cadef5f28210b7c83316d (patch) | |
tree | d2483f7f129e81b0581bd2e86880295f4df8ab6b | |
parent | 611a00b5108e7a81eedbdba37a816df060ef3eca (diff) |
aded negative integer division same as in python3
-rw-r--r-- | python.html.markdown | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python.html.markdown b/python.html.markdown index b7d5895a..312e3c15 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 |