Method on @sym: setdiff (A, B)

Set subtraction.

Example:

A = interval(1, sym(pi));
B = interval(sym(2), 3);
setdiff(A, B)
  ⇒ ans = (sym) [1, 2) ∪ (3, π]

You can mix finite sets and intervals:

setdiff(A, finiteset(3))
  ⇒ ans = (sym) [1, 3) ∪ (3, π]

setdiff(A, finiteset(sym(pi)))
  ⇒ ans = (sym) [1, π)

setdiff(finiteset(1, 2, sym(pi)), B)
  ⇒ ans = (sym) {1, π}

See also: @sym/union, @sym/intersect, @sym/setxor, @sym/unique, @sym/ismember, @sym/finiteset, @sym/interval.

Package: symbolic