UNPKG

@randplus/0to1

Version:

In theory, the random functions in this package can also output 1. This package is included in 'randplus'.

12 lines (11 loc) 256 B
/** * @function * Returns a number between 0 and 1. * @returns {number} Returns a number between 0 and 1. */ function random() { let result = Math.random(); if (Math.random() == 0) result = 1; return result; } module.exports = random;