Skip to content

Commit 518fe13

Browse files
committed
[css-values-4] Per Oriol, fix the 'equivalent expression' to mod(). Fixes w3c#4718.
1 parent 890c0e5 commit 518fe13

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

css-values-4/Overview.bs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2749,8 +2749,11 @@ Stepped Value Functions: ''round()'', ''mod()'', and ''rem()''</h3>
27492749

27502750
Note: ''mod()'' and ''rem()''
27512751
can also be defined directly in terms of other functions:
2752-
''mod(A, B)'' is equivalent to ''calc(A - round(down, A, B))'',
2752+
''mod(A, B)'' is equivalent to ''calc(A - sign(B)*round(down, A*sign(B), B))''
2753+
(a hacky way to say "round(down) when B is positive, round(up) when B is negative),
27532754
while ''rem(A, B)'' is equivalent to ''calc(A - round(to-zero, A, B))''.
2755+
(These expressions don't always handle 0⁺ and 0⁻ correctly, though,
2756+
because 0⁻ semantics aren't commutative for addition.)
27542757

27552758
<h4 id=round-infinities>
27562759
Argument Ranges</h4>

0 commit comments

Comments
 (0)