Toward defining the length of a subset of real numbers, we start by defining the length of an interval.
The length of an interval is the difference of its endpoints: the larger less the smaller.
Let $a, b$ be real numbers which satisfy the relation $a < b$. The length of $(a, b)$, $[a, b]$ $[a, b)$ and $(a, b]$ is, in each case, $b - a$.
For example, the length of the interval $(0, 1)$ is 1.