359
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 22 Feb 2026
359 points (100.0% liked)
Programmer Humor
41271 readers
29 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
I'm confused, shouldn't this be printing false no matter what the input is?
The test suite probably looks something like this:
Ah that makes more sense thanks. So the bottom one is a unit test and not the code being run itself
The output is not the output of the algorithm, it's the output of the unit test.
95% of numbers up to that point at not prime. Testing the algorithm that only says "not prime" is therefore correct 95% of the time. The joke is that, similar to AI, the algorithm is being presented as a useful tool because it's correct often but not always.