this post was submitted on 09 Feb 2024
878 points (100.0% liked)

Programmer Humor

22444 readers
3221 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
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 27 points 1 year ago (1 children)

rand will be called every time true is used, which could be hundreds of times for all we know

[โ€“] [email protected] 26 points 1 year ago

If it's a 16-bit integer platform, it might hit every once in a while.

If it's a 32-bit integer platform, it'll hit very rarely.

If it's a 64-bit integer platform, someone would have to do the math with some reasonable assumptions, but I wouldn't be surprised if it would never hit before the universe becomes nothing but black holes.