lua-users home
lua-l archive

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


On 14.11.2012, at 8.27, Dirk Laurie wrote:
> 
> This definition screams for the symbol `/%`.
> 
>> q, r = 42 /% 10  --> 4,2
> 
> Dirk
> 

Indeed. But /% looks like some sort of escape sequence, I would perhaps go with %%.

A real integer type and adding //, would pave the way for bitwise operators <<, >>, | and &
(don't know what to do about ^ because it's already in use). This would make Lua a better fit for those applications that rely on bit crunching operations. 

May I ask what is the opinion of Roberto regarding these new operators?

Alternatively, if new operators are generally frowned upon, then maybe the new integer operations should be made into functions math.idiv and math.imod?

Petri