I am looking for a function that returns the number of subsets of size $k$ of a set of size $n$. Ideally, the function is commonly used.
I took a look at the binomial coefficient. However, there seems to be a problem if $k$ is greater than $n$. For example, if $k = 2$ and $n = 1$, then we consider the number of two-element subsets of a singleton. In the example, the function that I am looking for should return $0$ and the binomial coefficient $\binom{n}{k}$ seems to be undefined.
P.S.: I used the following definition for the binomial coefficient (see the tag info page for binomial-coefficients): $\dfrac{n!}{k!(n-k)!}$
Actually, the binomial coefficient works in this case since for $k>n$ we have one factor in the numerator which equals zero:
$$\binom{n}{k} = \frac{n(n-1)\cdots\overbrace{(n-n)}^{=0}\cdots(n-k+1)}{k!}=0$$