Java Random Float Number randFloat(float min, float max)

Here you can find the source of randFloat(float min, float max)

Description

rand Float

License

Open Source License

Declaration

public static float randFloat(float min, float max) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Random;

public class Main {
    private static Random random = new Random();

    public static float randFloat(float min, float max) {
        return random.nextFloat() * (max - min) + min;
    }//from   w  w  w .j a  v  a 2  s . c o  m
}

Related

  1. randFloat(float min, float max)
  2. randFloat(float min, float max, long seed)
  3. randomFloat(float min, float max)