3 ms·
Here is a guy who doesnt know what he is talking about. And he proposes to implement a new language that fixes Python's flaws. Integer division is a slippery
by russell 15y ago
Here is a guy who doesnt know what he is talking about. And he proposes to implement a new language that fixes Python's flaws.
Integer division is a slippery concept. Python 2.4 returns the floor of the result.
>>> -(5/3)
-1
>>> -5/3
-2
If a language "rounds" towards zero the results will be different and equal.
>>> from __future__ import division
>>> -(5/3)
-1.6666666666666667
>>> -5/3
-1.6666666666666667
The results are the same, but probably not what he is expecting.
The discussion about .1 reveals a fundamental misunderstanding about floating point;. You cannot represent .1 exactly. FP should not be used for financial applications if you want exact results. Use Decimal instead.
On the other hand, maybe understands all this and is just fishing for a language development project.