Skip to content

Commit

Permalink
JS: Fix Math.random()?
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Apr 2, 2024
1 parent 2c7cb8a commit 2e35332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion applications/system/js_app/modules/js_math.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void js_math_random(struct mjs* mjs) {
mjs_return(mjs, MJS_UNDEFINED);
}
const uint32_t random_val = furi_hal_random_get();
double rnd = (double)random_val / RAND_MAX;
double rnd = (double)random_val / FURI_HAL_RANDOM_MAX;
mjs_return(mjs, mjs_mk_number(mjs, rnd));
}

Expand Down

0 comments on commit 2e35332

Please sign in to comment.