Algosim documentation: contains

contains

Tests if a container contains a given value.

Syntax

Description

If X is a container and x any value, then contains(X, x) returns true iff X contains an element with value identical to x.

contains(X, x, ε) has the same behaviour, but compares floating-point values with epsilon ε if ε > 0. If ε = 0, a default (non-zero) epsilon is used.

Examples

Alice ≔ ExampleData("Alice in Wonderland");
contains(words(Alice) @ LowerCase, "perfunctorily")
false
contains(words(Alice) @ LowerCase, "splendidly")
true

See also