Hi all!! I apologize my poor english. I need to generate a serie of random numbers utilizing the functions RAND e SRAND in a limited range, ex 0 to 7, 30 to 76, etc. How can I create these numbers?? Can anybody help me??? Thanks in advance. Mauricio.
I seem to remember reading somewhere that the least significant bits of the return value of [a typical implementation of] rand() tend to be less 'random' than the most significant bits. I think that this applies to Linear Congruential Generators (LCG) that were, and still are, common. The Keil library function uses a Linear Feedback Shift Register (LFSR) method. In the case of an LFSR, all the bits are equally pseudo-random so that, aside from portablility issues, it really does not matter which bits you take.
This whole thread is incorrect. The means discussed are not for random numbers but for pseudo-random numbers. Do not confuse the two. Erik