  This paper presents an extension of Bhargava's theory of factorials
associated to any nonempty subset $S$ of $\mathbb{Z}$. Bhargava's factorials
$k!_S$ are invariants, constructed using the notion of $p$-orderings of $S$
where $p$ is a prime. This paper defines $b$-orderings of any nonempty subset
$S$ of $\mathbb{Z}$ for all integers $b\ge2$, as well as "extreme" cases $b=1$
and $b=0$. It defines generalized factorials $k !_{S,T}$ and generalized
binomial coefficients $\binom{k+\ell}{k}_{S,T}$ as nonnegative integers, for
all nonempty $S$ and allowing only $b$ in $T\subseteq\mathbb{N}$. It computes
$b$-ordering invariants when $S$ is $\mathbb{Z}$ and when $S$ is the set of all
primes.
