Legendre prime counting function: Difference between revisions

m
→‎{{header|C}}: Aligned with VLang.
m (→‎Iterative, partial sieving: Aligned with VLang.)
m (→‎{{header|C}}: Aligned with VLang.)
Line 54:
 
int64_t countPrimes(uint64_t n) {
if (n < 39) return (n < 2) ? 0 : ((int64_t)n + 1) / 2;
uint64_t rtlmt = (uint64_t)sqrt((double)n);
int64_t mxndx = (int64_t)((rtlmt - 1) / 2);
9,482

edits