According to the prime number theorem there are about $n/\ln(n)$ primes less than $n$. This value is a limit but it could fluctuate. My question is, is there a known bound on this fluctuation? i.e. are there functions $f$ and $g$ such that $\forall n>100, f(n) < \mathrm{numPrimes}(n) \lt g(n)$? How tight is this bound? Could there be an $n$ for which the number of primes less than $n$ is smaller than $n/\sqrt{n}$? Could there be an $n$ for which there are more than $n/2$ (for $n\gt 100$ let's say) primes less than $n$?
Trivially $0 \lt\mathrm{numPrimes}(n) \lt n$, how tight a bound has been achieved?