yes this will work:All 16 bits are random. Like I can do .
Can I do this ?
int16_t bitNum = rand()%100; //bitNum in the range of 0 to 99.
I'm assuming you are specifically asking about rand() and not why %100 makes it non uniform. I don't know too much about this subject, but here are some links that might give you more info:Would you mind explaining that further? Layman's terms a bonus. Not a software person, but not a stranger to math either; the above made me curious.
a 16 bit number can range from 0 to 65535. If you apply %100 to get a value from 0-100 then you will have 655 sets of numbers that go from 0 to 100 and 1 set that goes from 0 to 35
So my questions for you to consider: Exactly what kind of random do you get
when you let the compiler decide for you? Is modulo 100 enough extra hash
to walk away and say "good enough"?