lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Lorenzo Donati <lorenzodonatibz@interfree.it> wrote:
>
>According to the following benchmarks, built-in math.floor and
>math.ceil
>are slower than their counterpart rewritten using the core % operator!
>
Partly because you're measuring table lookups. Alias math.floor and math.ceil to locals and the times I get go from 40% slower to just 25% slower.

Also, that ce2 function is wrong when x%1 equals 0.

--
tnharris
telliamed@whoopdedo.org