How can I compute random number between 0 inclusive and 1 inclusive? When I have Math.random() it is returning 0-0.9999999
I did not find any solution for that.
edit: I think that it could be somehow this way:
const precision = 1000
let c = 0
let min = 2
let max = -2
while(c !== 20000){
c++;
let r = (Math.round(Math.random()*precision)/precision)/0.9999999999999;
r = Math.round(r*precision)/precision
max = Math.max(r, max)
min = Math.min(r, min)
}
console.log('max:', max, 'min:', min)