Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mda
on Sept 1, 2014
|
parent
|
context
|
favorite
| on:
Predicting the next Math.random() in Java
Reminded me an interesting Java Random issue with small seeds and power of two intervals:
for(int i = 0; i < 256; i++) { System.out.println(new Random(i).nextInt(8)); }
It returns same number for all seeds.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: