These are called "
Pseudorandom number generators". 'pseudo' because they are not actually random, and do repeat, but their patterns are so far apart that it seems random.
If I want a number between 1 and 100, I can start off with '1', and add '6' to each value, my pattern of numbers goes like this:
1 7 13 19 ...snip... 85 91 97
Then the next value, 103, loops back around to '3'. Now it goes:
3 9 15 21 ...snip... 87 93 99
5 11 17 23 ...etc... 77 83 89 95
It generates 50 numbers before the pattern repeats. By 'pattern', it might touch the same value multiple times (it might generate '11' four or five times in the 50 numbers), but the full pattern of the generator doesn't repeat until after 50 numbers are generated.
In my example, the full pattern is:
1 7 13 19 25 31 37 43 49 55
61 67 73 79 85 91 97 3 9 15
21 27 33 39 45 51 57 63 69 75
81 87 93 99 5 11 17 23 29 35
41 47 53 59 65 71 77 83 89 95
Total: 50
If you have a 32 bit number (about 4 billion values) and create a algorithm that visits every number (hopefully an almost equal amount of times, not biased towards specific numbers), and does so in a way where the numbers can jump forward or backward (It might go 1 19 13 7 instead of 1 7 13 19 like my example did), then you'd have a decent pseudorandom generator.
You just need a more complex algorithm than just 'add 6'. Usually, they do this by manipulating the bits of the number, as well normal arithmetic.
Here's an
example that provides better results (still not fantastic though), but is simple enough to understand.
There are
many of them, some okay, others much
better.
Having the results as a float between 0.0 and 1.0 instead of an integer between 0 and <max value> is the same idea, just different final representation.