I know RAND_MAX = 32767, though I need to get a random number in the range [0, 100000000]. Is there a way of getting that using rand() ?
thanks (Using C)
I know RAND_MAX = 32767, though I need to get a random number in the range [0, 100000000]. Is there a way of getting that using rand() ?
thanks (Using C)
According to ISO C Random Number Functions the value of RAND_MAX seems to be implementation dependent:
The value of this macro is an integer constant representing the largest value the rand function can return. In the GNU C Library, it is 2147483647, which is the largest signed integer representable in 32 bits. In other libraries, it may be as low as 32767.
So perhaps you can try an alternate C library to achieve what you want.