Legendre prime counting function: Difference between revisions
m
→Iterative, partial sieving: Aligned with VLang.
m (→Iterative, partial sieving: Aligned with VLang.) |
m (→Iterative, partial sieving: Aligned with VLang.) |
||
Line 1,137:
func countPrimes(n uint64) int64 {
if n <
if n < 2 {
return 0
} else {
return (int64(n) + 1) / 2
}
}
|