# setSize() Function & Examples

Use the setSize() set function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## setSize

#### setSize(set)

#### setSize(set, unique)

Try it yourself:

```calculio
setSize([1, 2, 2, 4])
setSize([1, 2, 2, 4], true)
```

---

## Count distinct members with setSize

**setSize** returns the cardinality of a set: the number of unique members it contains. It is different from counting repeated entries in a list.

## Example

The set {a,b,c} has size 3. Use [count](https://calcul.io/function/count/index.md) for raw collection length and [setDistinct](https://calcul.io/function/setDistinct/index.md) to remove duplicates before reasoning about membership.

## Applications

Set size helps assess overlap and combinatorial growth. Pair it with [setIntersect](https://calcul.io/function/setIntersect/index.md) for shared values, [setUnion](https://calcul.io/function/setUnion/index.md) for combined membership, and [setPowerset](https://calcul.io/function/setPowerset/index.md) when estimating an exhaustive subset search.

[All functions](https://calcul.io/functions/index.md)
