函数 setDifference #

创建两个(多)集合的差集:set1 中的每个元素,但不属于 set2。 多维数组将在操作前转换为一维数组。

Syntax #

math.setDifference(set1, set2)

Parameters #

Parameter Type Description
a1 Array | Matrix 一个(多)集合
a2 Array | Matrix 一个(多)集合

Returns #

Type Description
Array | Matrix 两个(多)集合的差集

Throws #

Type | Description —- | ———–

Examples #

math.setDifference([1, 2, 3, 4], [3, 4, 5, 6])            // returns [1, 2]
math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])    // returns [1, 2]

另请参阅 #

setUnion, setIntersect, setSymDifference

Fork me on GitHub