modulus and array.length

Kagamin spam at here.lot
Tue Nov 16 13:55:29 PST 2010


Jérôme M. Berger Wrote:

> > -3 mod 3 = 0
> > -2 mod 3 = -2
> > -1 mod 3 = -1
> > 0 mod 3 = 0
> 
> 	Note that from a strictly mathematical point of view, this result
> is valid: for all x and all n, x-(x%n) is a multiple of n.

It's rather (x/n)+(x%n)==x


More information about the Digitalmars-d mailing list