source: node_modules/es-toolkit/dist/math/random.js

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 429 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5function random(minimum, maximum) {
6 if (maximum == null) {
7 maximum = minimum;
8 minimum = 0;
9 }
10 if (minimum >= maximum) {
11 throw new Error('Invalid input: The maximum value must be greater than the minimum value.');
12 }
13 return Math.random() * (maximum - minimum) + minimum;
14}
15
16exports.random = random;
Note: See TracBrowser for help on using the repository browser.