r/programminghorror
•
u/ShoeChoice5567
•
Oct 26 '26
•
1
1
c Using garbage values to generate pseudorandom numbers
Thing I came up with instead of paying attention to class today.
I tested it on this computer (windows 11 if it matters), and the first time it's ran, an actual "pseudorandom" number is returned and the following calls return 1.0 always.
View all comments
Show parent comment
1
u/etan1 Oct 30 '26
well, the bit pattern is randomized, and an entire range of them are nans, either signalling or nonsignalling ones