[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Integer division
- From: Petri Häkkinen <petrih3@...>
- Date: Wed, 14 Nov 2012 08:54:16 +0200
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