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

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

Description

rand Float

License

Open Source License

Declaration

private static float randFloat(float min, float max, long seed) 

Method Source Code

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

import java.util.Random;

public class Main {
    private static float randFloat(float min, float max, long seed) {
        Random generator = new Random(seed);
        if (generator.nextDouble() < 0.5) {
            return (float) (((1 - generator.nextDouble()) * (max - min)) + min);
        }//from ww w . ja va  2  s  .c o m

        return (float) ((generator.nextDouble() * (max - min)) + min);
    }
}

Related

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