par
par copied to clipboard
Warning: implicit conversion from 'int' to 'float' (RAND_MAX)
Hi there, par_shapes.h:1103:32:
warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]
note: expanded from macro 'RAND_MAX'
maybe change like this ? or do a c-style cast for RAND_MAX?
// float r = (float) rand() / RAND_MAX;
float r = rand() / (RAND_MAX + 1.0f); // [0, 1)
float r = rand() / (float)RAND_MAX; // [0, 1]