this post was submitted on 16 Jan 2024
103 points (99.0% liked)

Comics

572 readers
1 users here now

A community for sharing comics related to programming

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 2 years ago
MODERATORS
 

Transcript:

[A computer program.]

int getRandomNumber()
{
   return 4; // chosen by fair dice roll.
             // guaranteed to be random.
}

Hover Text:

RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.

you are viewing a single comment's thread
view the rest of the comments
[–] Lmaydev@programming.dev 2 points 2 years ago

It is a random number and returning the same number every time is technically valid. Just a poor implementation.