mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
[python/en] "rounds down" -> "rounds towards zero" (#4944)
This commit is contained in:
parent
90a16a6d5e
commit
c3f67d32c8
@ -39,7 +39,7 @@ syntactic clarity. It's basically executable pseudocode.
|
||||
10 * 2 # => 20
|
||||
35 / 5 # => 7.0
|
||||
|
||||
# Integer division rounds down for both positive and negative numbers.
|
||||
# Integer division rounds towards zero for both positive and negative numbers.
|
||||
5 // 3 # => 1
|
||||
-5 // 3 # => -2
|
||||
5.0 // 3.0 # => 1.0 # works on floats too
|
||||
|
Loading…
Reference in New Issue
Block a user