You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whatwg/streams#1145 wants to use the equivalent of JavaScript's % operator. This is surprisingly subtle because of the difference between modulo and remainder.
For Streams, the difference doesn't matter, since we only ever have positive dividends and divisors. From a quick look at Encoding, I think the same applies there.
What is the issue with the Infra Standard?
whatwg/streams#1145 wants to use the equivalent of JavaScript's
%
operator. This is surprisingly subtle because of the difference between modulo and remainder. See discussion in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder .I suggest the terminology "the [remainder after dividing] |dividend| by |divisor|".
I also suggest that we add a clear note about how this maps to some language's
%
operator (JavaScript, C, C++) but mismatches others (Python, Perl).There might also be some subtlety here about rounding toward 0 vs. not?
We should probably delegate the actual definition to https://tc39.es/ecma262/#sec-numeric-types-number-remainder , although I guess ideally we'd figure out #87 first.
/cc @MattiasBuelens
The text was updated successfully, but these errors were encountered: