5. Within the range of the independent variable $x$, $59 \leqslant x \leqslant 60$, the number of integer values of the quadratic function $y=x^{2}+x+\frac{1}{2}$ is ( ).
(A) 59
(B) 120
(C) 118
(D) 60
5.B.

Notice that $y=x^{2}+x+\frac{1}{2}=\left(x+\frac{1}{2}\right)^{2}+\frac{1}{4}$. When $x>-\frac{1}{2}$, $y$ increases as $x$ increases.
Since $59 \leqslant x \leqslant 60$, then
$$
59^{2}+59+\frac{1}{2} \leqslant y \leqslant 60^{2}+60+\frac{1}{2},
$$

which means $3540 \frac{1}{2} \leqslant y \leqslant 3660 \frac{1}{2}$.
This range contains $3660-3541+1=$ 120 integers.