Hacker News new | past | comments | ask | show | jobs | submit login

Math.random() should be used only for tests. That's it. Performance sucks as it's shared. ThreadLocalRandom is a lot better if you need fast but not-quality random.

And there is SecureRandom for security concerns.

Last fun fact Math.random() and a Monte Carlo test introduced "CAS in Java" and all that followed with JSR 166.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: