I'm trying to generate a random float number between 0 and 1.
0.0f + rand() % 1.0f;
But I get the following error after I compile with GCC:
error: invalid operands to binary % (have ‘int’ and ‘float’)
I'm trying to generate a random float number between 0 and 1.
0.0f + rand() % 1.0f;
But I get the following error after I compile with GCC:
error: invalid operands to binary % (have ‘int’ and ‘float’)