X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=random.js;h=15183472bc9b10a8ba9184b80fca3c82388a536c;hb=549b1a49723dce9d2b576bd5305a1419bb05bcd8;hp=272d8e6969c23f71c234cad66ca93d8ffbe889dd;hpb=823ca29667e5d5e4951f629ebe19ae8ec1f44b52;p=benchmarks-js.git diff --git a/random.js b/random.js index 272d8e6..1518347 100644 --- a/random.js +++ b/random.js @@ -74,7 +74,7 @@ Benchmark.suite( ), Benchmark.add('Crypto random integer generator', (max = maximum, min = 0) => { max = Math.floor(max) - if (min !== undefined && min !== 0) { + if (min != null && min !== 0) { min = Math.ceil(min) return Math.floor(crypto.randomInt(min, max + 1)) }