tycho-solver
Version:
Evolutionary computation and optimization library
20 lines (19 loc) • 460 B
JavaScript
;
/**
* Utility functions for Tycho Solver
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.random = random;
exports.randomInt = randomInt;
/**
* Generates a random number between min and max
*/
function random(min, max) {
return min + Math.random() * (max - min);
}
/**
* Generates a random integer between min and max (inclusive)
*/
function randomInt(min, max) {
return Math.floor(random(min, max + 1));
}