Talk:Legendre prime counting function: Difference between revisions
Content added Content deleted
(→V and C entries giving the wrong answer for a trillion numbers: Replied to GordonBGood.) |
(→V and C entries giving the wrong answer for a trillion numbers: Problem with n = 3 to 8.) |
||
Line 60: | Line 60: | ||
::: It's all making perfect sense now :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 09:51, 11 November 2022 (UTC) |
::: It's all making perfect sense now :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 09:51, 11 November 2022 (UTC) |
||
A minor point but I've just noticed that the V entry (and hence the translations of it) don't deal with the trivial cases n = 3 to 8 inclusive. To solve it without messing with the algorithm I suggest inserting the following as the second line of the ''count_primes_to'' function: |
|||
<pre> |
|||
if n < u64(9) { return i64((n + 1) / 2) } |
|||
</pre> --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 20:50, 12 November 2022 (UTC) |