this post was submitted on 22 Feb 2026
312 points (98.8% liked)

Programmer Humor

41092 readers
492 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] 418_im_a_teapot@sh.itjust.works 4 points 4 hours ago

We could probably improve on that significantly without losing speed.

return $x < 8

That should yield one additional correct answer, while also confusing anyone who thinks it just returns false.

And if we just hard coded and checked the first 20 or so primes before always returning false, we would probably get noticeable improvement (depending on the total range).