330
submitted 8 months ago by Jakylla@sh.itjust.works to c/xkcd@lemmy.world

cross-posted from: https://programming.dev/post/8677292


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
[-] captainjaneway@lemmy.world 14 points 8 months ago

I generate a random number and then use that number as a seed. I then generate a random number. Then I use that number as a seed. I then generate a random number. I divide that number by a random prime number picked in a similar fashion. I take the last n-digits of the remainder and that's the random number I give to a user.

this post was submitted on 20 Jan 2024
330 points (100.0% liked)

xkcd

8580 readers
1 users here now

A community for a webcomic of romance, sarcasm, math, and language.

founded 1 year ago
MODERATORS