748
submitted 1 day ago* (last edited 1 day ago) by not_IO@lemmy.blahaj.zone to c/programmer_humor@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] Semi_Hemi_Demigod@lemmy.world 8 points 10 hours ago* (last edited 10 hours ago)

If you scaled it based on the size of the integer you could get that up to 99.9% test accuracy. Like if it's less than 10 give it 50% odds of returning false, if it's under 50 give it 10% odds, otherwise return false.

[-] LodeMike@lemmy.today 1 points 1 hour ago

That would make it less accurate. It's much more likely to return true on not a prime than a prime

[-] Semi_Hemi_Demigod@lemmy.world 1 points 1 hour ago

Code proof or it didn't happen.

Extra credit for doing it in Ruby

[-] JackbyDev@programming.dev 1 points 1 hour ago

Makes me wonder where the actual break even would be. Like how long dies making one random number take versus sins lookups. Fuck it, do it in parallel. Fastest wins.

[-] Jayjader@jlai.lu 3 points 6 hours ago

Now you're thinking with ~~portals~~ primes!

this post was submitted on 22 Feb 2026
748 points (99.3% liked)

Programmer Humor

29947 readers
1060 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS