Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mmcnickle
on Feb 28, 2024
|
parent
|
context
|
favorite
| on:
Why Python's integer division floors (2010)
The same reason int(-1.999) is -1; The operation is different to integer division. I think of it as taking the "integer" part of the float.
Izkata
on Feb 28, 2024
[–]
As the article mentions, this is called truncation. It truncates (cuts off) the value at the decimal point.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: