Re: [whatwg/encoding] "In equations, all numbers are integers, additio..." (#66)

The reason isn't that compilers can more easily deal with multiplications. The reason why I asked for that change is three-fold:

1. Even when two expressions involving one variable and a bunch of constants are equivalent in abstract infinite-precision math or in two's complement math without under/overflow checking, the order in which operations may be significant when under/overflow checking is involved. The sure way not to introduce badness from repetitive under/overflow checking is to make sure that all the operations that can be performed on the constants only are grouped together so that those operations can be folded ahead of time.
2. It's clearer for the reader to see that there is, indeed, the same folded constant repeating if it appears as the same parenthetized multiplication both times instead of masquerading as a bunch of divisions.
3. When the same operands appear both with `/` and `%`, this makes it clear (to humans and hopefully computers) that an operation that outputs both the quotient and the remainder in one go.

I think the spec should get rid of the "floor()" notation and instead define `/` as an integer division operator that performs division on two integers, returns the quotient and discards the remainder.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/66#issuecomment-237501683

Received on Thursday, 4 August 2016 09:36:26 UTC