this post was submitted on 28 Dec 2023
339 points (97.5% liked)

Programmer Humor

19623 readers
85 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 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 18 points 11 months ago* (last edited 11 months ago) (1 children)

Yeah but then ALL even numbers would be slow to compute because you would have to chain through every odd before you know that 2 is even.

Depends on the expected distribution of input values

[โ€“] [email protected] 1 points 11 months ago

Heuristic: keep it until 512, afterwards powers of 2, and numbers like 1000, 2000,.., 10000, 20000,... (regex: [0-9]000+)