Javascrpt Math.random выдаёт 1(единичек) больше чем 0(нулей)

in #javascrpt5 years ago (edited)

Просто оставлю это здесь
генератор псевдослучайных чисел в моём node.js когда циклов >10млрд и более, начинает выдавать значений второй половины (от 0.5 включительно до 0.(9) ) больше чем первой ( от 0 до 0.5). второй половины за ночь стало больше на 1.5 миллиарда ))).

ну это и понятно, ведь числа сам из себя считает

используйте get-random-values

и я вот что подумал. блоки то тоже сами из себя там выходят как-то, нет ли там никаких погрешностей в случайности хэшей?

Sort:  

Hello @smi! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account!

Partiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token!

https://partiko.app/referral/partiko

Congratulations @smi! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!