Skip to content

Commit 43c7853

Browse files
darrnshntabatkins
authored andcommitted
Clarify the union of two unit maps (#593)
1 parent d7cf0ed commit 43c7853

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

css-typed-om/Overview.bs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ The following are the arithmetic operations you can perform on dimensions:
11401140
1. Let |item| be a [=tuple=] with its [=sum value/value=]
11411141
set to the product of the [=sum value/values=] of |item1| and |item2|,
11421142
and its [=sum value/unit map=]
1143-
set to the union of the [=sum value/unit maps=] of |item1| and |item2|,
1143+
set to the [=product of two unit maps|product=] of the [=sum value/unit maps=] of |item1| and |item2|,
11441144
with all [=map/entries=] with a zero value removed.
11451145

11461146
2. Append |item| to |temp|.
@@ -1214,6 +1214,21 @@ The following are the arithmetic operations you can perform on dimensions:
12141214

12151215
3. Return the result of [=multiplying=] all the [=list/items=] of |types|.
12161216
</div>
1217+
1218+
<div algorithm>
1219+
The <dfn>product of two unit maps</dfn> |units1| and |units2|
1220+
is the result given by the following steps:
1221+
1222+
1. Let |result| be a copy of |units1|.
1223+
1224+
2. [=map/For each=] |unit| → |power| in |units2|:
1225+
1226+
1. If |result|[|unit|] [=map/exists=],
1227+
increment |result|[|unit|] by |power|.
1228+
3. Otherwise, set |result|[|unit|] to |power|.
1229+
1230+
3. Return |result|.
1231+
</div>
12171232
</div>
12181233

12191234
The {{CSSNumericValue/parse()}} method allows a {{CSSNumericValue}}

0 commit comments

Comments
 (0)