Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
07-16-2014, 09:39 PM #1
- Join Date
- Jul 2014
- Thanked 0 Times in 0 Posts
Knuth's subtractive random number generator. Which variables can be changed?
I have Knuth's subtractive random number generator code taken from this site: Subtractive generator - Rosetta Code
My question is:
What are the manipulating variables and what are the costants?
Are all the numbers in this code variables?
07-22-2014, 01:33 AM #2
Except for these variablesCode:
int state, si = 0, sj = 0;
int main()is just code to demonstrate how to use the two functions. You can throw it away and incorporate the other code in you C or C++ code (though it would be better to rewrite this a class in C++, of course).Be yourself. No one else is as qualified.