Sublime Forum

Embedded interpreter - division mistake

#1

Sublime text v 2.0.2
Embedded Python interpreter when dividing through the console gives wrong results, like it calculates integer division instead of a normal one. In example…

100/24
4

96/24
4

90/24
3

P.S. Thanks a lot for such a great text editor! I really enjoy using it

0 Likes

#2

This is a “feature” of python. I recommend upgrading to Sublime Text 3 and python 3, where this “feature” has luckily been killed.
hint: you are in fact dividing integers, not floats.

0 Likes