utils: Fix build warning with clang 10.0.1
/[...]/openomf/src/utils/random.c:26:38: warning: implicit conversion from 'unsigned int' to 'float' changes value from to [-Wimplicit-int-float-conversion]
return (float)random_intmax(r) / UINT_MAX;
~ ^~~~~~~~
/usr/lib64/clang/10.0.1/include/limits.h:56:37: note: expanded from macro 'UINT_MAX'
~~~~~~~~~~~~~~~~~^~~
@@ -23,7 +23,7 @@ uint32_t random_intmax(struct random_t *r) {
}
float random_float(struct random_t *r) {
- return (float)random_intmax(r) / UINT_MAX;
+ return (float)random_intmax(r) / (float)UINT_MAX;
}
void rand_seed(uint32_t seed) { random_seed(&rand_state, seed); }
