Medallia Engineering Blog

Medallia Engineering Blog

A look inside what we are building

A Plea for an Equal Opportunity Random

Daniel Vega / 2014-08-04 / Coding
I was reading the documentation for Random.nextDouble() in Java 8 The general contract of nextDouble is that one double value, chosen (approximately) uniformly from the range 0.0d (inclusive) to 1.0d (exclusive), is pseudorandomly generated and returned Nothing new here. It just returns a uniform distributed random value in the interval [0, 1) (uniform means that for any two subintervals with the same length there is an equal chance the returned number is inside any of them). Continue reading