There was an error while loading. Please reload this page.
1 parent 336aa9c commit 55d4bd2Copy full SHA for 55d4bd2
1 file changed
tests/unit/test_fixed_point.c
@@ -287,8 +287,8 @@ void test_random_torture(void) {
287
288
for (int i = 0; i < 1000; i++) {
289
/* Generate random values in safe range [-100, 100] */
290
- float f_a = ((float)rand() / RAND_MAX) * 200.0f - 100.0f;
291
- float f_b = ((float)rand() / RAND_MAX) * 200.0f - 100.0f;
+ float f_a = ((float)((double)rand() / (double)RAND_MAX)) * 200.0f - 100.0f;
+ float f_b = ((float)((double)rand() / (double)RAND_MAX)) * 200.0f - 100.0f;
292
293
fixed_t a = fixed_from_float(f_a);
294
fixed_t b = fixed_from_float(f_b);
0 commit comments