> >I need to generate a long random number upto 4 byte width
but my compiler is generating 2 byte int type as RAND_MAX
i want to genetrate a rand num like 123456789 that long
randomnumber1 = rand();
randomnumber2 = rand();
longrandomnumber = (randonumber1 << 16) | randonmumber2;
I use this too, but I have something else:
So, It is in x86 Assembly, I convert it ;-)
--------- seed is the seed ;-) -----------
mov eax, [seed]
mul eax, 343fdh
add eax, 269ec3h
mov [seed],eax
---------first time random = seed-------
random = random * 0x343fd + 0x269ec3;
----------------------------------------
This is part of code which produce VC++ 6.0 compiler for 'rand()'
I have changed this code to return 32 bit random values