You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I met a nasty bug that will now wake me up at night... It concerns floating point operations and I feel like it is not really included in your list. Note that one could argue this problem is not python specific but it still caused some nasty bug and people might want to be aware of this. (This blog reminded me of the bug and helped me formulate it more clearly here). It boils down to:
1 + 2 == 3
True
(1 + 2)/10 == 3/10
True
1/10 + 2/10 == 3/10
False
.1 + .2 == .3
False
And of course :
0.3 - 0.2 - 0.1 == 0
False
The text was updated successfully, but these errors were encountered:
I met a nasty bug that will now wake me up at night... It concerns floating point operations and I feel like it is not really included in your list. Note that one could argue this problem is not python specific but it still caused some nasty bug and people might want to be aware of this. (This blog reminded me of the bug and helped me formulate it more clearly here). It boils down to:
1 + 2 == 3
True
(1 + 2)/10 == 3/10
True
1/10 + 2/10 == 3/10
False
.1 + .2 == .3
False
And of course :
0.3 - 0.2 - 0.1 == 0
False
The text was updated successfully, but these errors were encountered: