Re: [csswg-drafts] [css-values] Add round()/floor()/ceil() functions (#2513)

So, to clarify:

- `rem(-8,3)` in CSS will give the same result as `-8 % 3` in JS, aka -2 — the difference since the last multiple of 3 when counting _away from zero_: -8 is -2 beyond -6=3*(-2). The result of `rem()` is negative if the first value is negative.

  In general, `rem(<value>, <step-size>)` equals `calc(<value> - round(to-zero, <value>, <step-size>)`

- `mod(-8,3)` in CSS will give +1 — the amount greater than the next smaller multiple of 3 (meaning, closer to negative infinity): -8 is +1 above -9=3*(-3). The result of `mod()` is always positive.

  In general, `mod(<value>, <step-size>)` equals `calc(<value> - round(down, <value>, <step-size>)`


-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2513#issuecomment-578189696 using your GitHub account

Received on Friday, 24 January 2020 15:57:45 UTC