[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 20:32:33 +0200
On 14.11.2012, at 20.17, Roberto Ierusalimschy wrote:
>> What I meant was: I would prefer separate operators // and %% (integer division and modulo) over /%. The reason: there are no combined operators +-, */, <> etc. either…. you get the idea ;-)
>
> There is no need for an integer modulo operator. Like all arithmetic
> operations except division, the modulo of two integers is always an
> integer. So, modulo can follow the generic rule: modulo of two integers
> results in an integer, modulo of anything else results in a float.
Ah, of course! Sorry for the noise.
Petri