Lua is faster than Fortran???

David Cournapeau cournape at gmail.com
Sun Jul 4 12:34:57 EDT 2010


On Mon, Jul 5, 2010 at 1:12 AM, sturlamolden <sturlamolden at yahoo.no> wrote:
> On 4 Jul, 10:03, Stefan Behnel <stefan... at behnel.de> wrote:
>
>> Sort of. One of the major differences is the "number" type, which is (by
>> default) a floating point type - there is no other type for numbers. The
>> main reason why Python is slow for arithmetic computations is its integer
>> type (int in Py3, int/long in Py2), which has arbitrary size and is an
>> immutable object. So it needs to be reallocated on each computation.
>
> That is why Lua got it right. A floating point type has a mantissa and
> can duck type an integer. MATLAB does the same.

I sincerly doubt it - where do take the information that matlab use
float to represent int ? It would not be able to represent the full
range of 64 bits integer for example.

David



More information about the Python-list mailing list