337
submitted 1 day ago* (last edited 1 day ago) by cypherpunks@lemmy.ml to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] 418_im_a_teapot@sh.itjust.works 10 points 1 day 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).

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

Programmer Humor

41113 readers
83 users here now

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

Rules:

founded 6 years ago
MODERATORS