Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mmcnickle
· 2y ago · 0 comments
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.
Comments
[–]
Izkata
2y ago
As the article mentions, this is called truncation. It truncates (cuts off) the value at the decimal point.