Here you can find the source of getRandomFloat()
public static float getRandomFloat()
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ThreadLocalRandom; public class Main { /**/* w w w. ja va 2 s.c o m*/ * returns (.nextFloat() * 10 ) * (1/2 chance of *= -1) * * @return */ public static float getRandomFloat() { float randomFloat = ThreadLocalRandom.current().nextFloat() * 10; float coinFlip = ThreadLocalRandom.current().nextInt(2); if (coinFlip > 0) { randomFloat *= -1; } return randomFloat; } }