mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
comment about floats in integer division
This commit is contained in:
parent
daf83c9123
commit
7bcf65278c
@ -40,7 +40,7 @@ Note: This article applies to Python 3 specifically. Check out the other tutoria
|
||||
|
||||
# Result of integer division truncated down both for positive and negative.
|
||||
5 // 3 # => 1
|
||||
5.0 // 3.0 # => 1.0
|
||||
5.0 // 3.0 # => 1.0 # works on floats too
|
||||
-5 // 3 # => -2
|
||||
-5.0 // 3.0 # => -2.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user