In JavaScript, the largest odd positive number representable is $2^{53}-1$. All integers between 1 and $2^{53}-1$ can be represented without loss of precision.
How many prime numbers can be represented in JavaScript? I know this can be approximated with the prime counting formula $\frac x{\ln x}$:
$$\frac{2^{53}}{\ln2^{53}}=\frac{2^{53}}{53\ln2}\approx 2.45\times10^{14}$$
How would one go about calculating an exact result?
Evidently $$ \pi(2^{53}) = 252252704148404, $$ roughly $2.5 \cdot 10^{14}.$ Hmmm; since $2^{53}$ is composite, this is also your answer.
This is from a link off http://en.wikipedia.org/wiki/Prime-counting_function
To confirm the table and notation used, it is true that $\pi(2) = 1, $ $ \; \pi(4) = 2, $ $ \; \pi(8) = 4, $ $ \; \pi(16) = 6, $ $ \; \pi(32) = 11. $