Code: Select all
srand(1234);
for(int i=10;;i--)
int r = rand()%10+1;
of Intel or AMD CPU used on MSVC2008. I only have intel.
Regards
Etric
Code: Select all
srand(1234);
for(int i=10;;i--)
int r = rand()%10+1;
Repeatable "random" (pseudo-) sample-and-hold effect comes to mind.mystran wrote:though I have some trouble imagining why you'd want consistent results from it anyway?
Oh ok, I guess I'm too purist to think such things should be repeatable.Meffy wrote:Repeatable "random" (pseudo-) sample-and-hold effect comes to mind.mystran wrote:though I have some trouble imagining why you'd want consistent results from it anyway?
It is part of a physical modelling algorithm.mystran wrote:...though I have some trouble imagining why you'd want consistent results from it anyway?
Code: Select all
#define ku32A 0x19660D // from Numerical Recipes
#define ku32C 0x3C6EF35F // a prime near (sqrt(5) - 2) * M ( 2^32 here)
unsigned long gdwAcc; // global 32-bit running accumulator
unsigned long NextLCGen()
{
return (gdwAcc = (gdwAcc * ku32A) + ku32C);
}
© KVR Audio, Inc. 2000-2024
Submit: News, Plugins, Hosts & Apps | Advertise @ KVR | Developer Account | About KVR / Contact Us | Privacy Statement