max value for seed for srand() function

In Keil's functions, the value for the seed value for srand() is 'unsigned int' according to their function definition.  Which for my processor is 4 bytes - sizeof(unsigned int) = 4.  However, it looks like the higher 2 bytes are ignored (seed value of 0x00001234 produces the same random numbers as 0x00011234 and all other values of the top 2 bytes).  So, is it really just 2 bytes or 65535 the largest seed value and not based on the size of 'unsigned int' of your processor?  Which I read online in other forums as the norm.  Thanks.

Sutton

Parents
  • you proved t yourself.

    why not use a REAL random instead of simulated random.  have a timer free running and read it when you need a random number

    n anecdote:illustrating the danger of simulated random

    J1708 specify to add a random delay when collisions happen.  Two units with the same simulated random collided forever

Reply
  • you proved t yourself.

    why not use a REAL random instead of simulated random.  have a timer free running and read it when you need a random number

    n anecdote:illustrating the danger of simulated random

    J1708 specify to add a random delay when collisions happen.  Two units with the same simulated random collided forever

Children
More questions in this forum