Greetings,
I have a question regarding the ANSI C rand() function. I was hoping someone might have an answer.
In the function rand() there is a variable 'next'. Now the function gives a new value to 'next' everytime it is called. See code below. Now this 'next' grows to a very large value fairly quickly. So my question is: Is there no limit to how large this number can get or does it hit a certain value and continue from zero. ex. An 8 bit system might go like this: 50 + 250 = 45. I don't know that answer and am curious how this works.
ANSI C rand() code from memory so it might not be exact but the idea is there.
int next = 1;
int rand()
{
next = next * 1115438782 + 12345;
return((unsigned int)next/65234 % 32123)
}