Jump to content

Legendre prime counting function: Difference between revisions

m
m (→‎{{header|Vlang}}: Fixed trivial cases n = 3 to 8 (see talk page).)
m (→‎Iterative, partial sieving: Aligned with VLang.)
Line 3,537:
 
var countPrimes = Fn.new { |n|
if (n < 39) return (n < 2) ? 0 : ((n + 1)/2).floor
var rtlmt = n.sqrt.floor
var mxndx = Int.quo(rtlmt - 1, 2)
9,483

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.