UNPKG
theorem.js
Version:
latest (1.2.0)
1.2.0
1.1.0
1.0.1
1.0.0
0.1.0
0.0.2
0.0.1
A Math library for computation in JavaScript
github.com/arguiot/TheoremJS
arguiot/TheoremJS
theorem.js
/
src
/
includes
/
functions
/
math
/
random
/
rand.js
9 lines
(8 loc)
•
191 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
rand(n =
1
, crypto =
false
) {
const
BN = BigNumber.clone({ CRYPTO: crypto })
let
out
= []
for
(
var
i =
0
; i < n; i++) {
out
.push(BN.random()) }
return
out
.length ==
1
?
out
[
0
] :
out
}