|
|
|
|
|
by BoppreH
4445 days ago
|
|
I disagree. A strong type system is good, but in this case pragmatism wins the battle. I personally have been bitten innumerous times by bugs where division was rounded down (usually to 0, which is especially destructive). Most of the numbers I encounter start as integers and most of the calculations I need are floating-point. This language behavior saves me from sprinkling "* 1.0" everywhere on my code, or from introducing extremely subtle bugs. And the integer division is always there, one character away: print(1//2 * 1000) # 0
|
|