Claude Pache (2013-09-16T13:28:03.000Z)
domenic at domenicdenicola.com (2013-09-25T02:47:20.516Z)
I have almost opened a duplicate of https://bugs.ecmascript.org/show_bug.cgi?id=980. I find that the somewhat convoluted definition given at the end of section 5.2: > The notation “x modulo y” (y must be finite and nonzero) computes a value k of the same sign as y (or zero) such that abs(k) < abs(y) and x−k = q × y for some integer q. can be usefully simplified and made clearer by saying: > The expression “x modulo y”, where y is a positive integer, evaluates to the unique value k such that 0 ≤ k < abs(y) and x − k = q × y for some integer q. To the reason given not to simplify ("it doesn't hurt and maybe someday in the future it will be needed"), there is a simple one-word response: YAGNI. At least, restricting to positive numbers for the second operand has the following concrete advantage: it saves the reader from useless metaphysical question about the sign of the result. (And for restricting to integers?... uh... just YAGNI.)