Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Casting float to int gives different results
Asked
Apr 15 '17 at 21:37
Active
Apr 15 '17 at 22:07
Viewed
36 times
1
Why does
int((1 - 0.1)*100)
result in
90
, while
int((1 - 0.05 - 0.05)*100)
result in
89
?
python
printing
casting
floating-point
int
edited Apr 15 '17 at 22:07
martineau
119,623
25
170
301
asked Apr 15 '17 at 21:37
Ryan R
13
6
0 Answers
0