Why does variable 'a = 123465789123456789' have a different value than variable 'b = int(123456789123456789.0)'?
Asked
Active
Viewed 29 times
0
-
What do you get for `b`? – mkrieger1 Apr 06 '21 at 17:28
-
Not related but your numbers aren't the same anyway, decimal or not. Look closely at the number order for variable a. – JD2775 Apr 06 '21 at 17:33
-
I got 5 less in b then in a. Oh yes, I was mistyping the number. Thats not wos I was up to though XD – Pontigoner Racing Apr 06 '21 at 20:03
1 Answers
0
Because python’s float (like in any other language) have a limit in precision, and you’ve reached it. On contrary, python’s integer type is of arbitrary precision, meaning that you’ll never reach its limit.

TUI lover
- 542
- 4
- 16