Jump to navigation

Namespace: setmath

Numbas.setmath

Set operations.

Source:

Methods

(static) contains(set, element, scope) → {boolean}

Does the set contain the given element?

Parameters:
Name Type Description
set set
element *
scope Numbas.jme.Scope

The scope to use for normalising names.

Returns:
Type Description
boolean
Source:

(static) eq(a, b, scope) → {boolean}

Are two sets equal? Yes if a,b and (a intersect b) all have the same length.

Parameters:
Name Type Description
a set
b set
scope Numbas.jme.Scope

The scope to use for normalising names.

Returns:
Type Description
boolean
Source:

(static) intersection(a, b, scope) → {set}

Intersection of two sets.

Parameters:
Name Type Description
a set
b set
scope Numbas.jme.Scope

The scope to use for normalising names.

Returns:
Type Description
set
Source:

(static) minus(a, b, scope) → {set}

Set minus - remove b's elements from a.

Parameters:
Name Type Description
a set
b set
scope Numbas.jme.Scope

The scope to use for normalising names.

Returns:
Type Description
set
Source:

(static) size(set) → {number}

Size of a set.

Parameters:
Name Type Description
set set
Returns:
Type Description
number
Source:

(static) union(a, b, scope) → {set}

Union of two sets.

Parameters:
Name Type Description
a set
b set
scope Numbas.jme.Scope

The scope to use for normalising names.

Returns:
Type Description
set
Source: