locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
13 lines (12 loc) • 457 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.lcg_value = lcg_value;
function lcg_value() {
// discuss at: https://locutus.io/php/lcg_value/
// parity verified: PHP 8.3
// original by: Onno Marsman (https://twitter.com/onnomarsman)
// example 1: var $rnd = lcg_value()
// example 1: var $result = $rnd >= 0 && $rnd <= 1
// returns 1: true
return Math.random();
}