/** * Returns a random value according to the exponential distribution with the provided mean. * * @param random a uniformly distributed random value. * @param mean the desired mean. */ public static float Exponential(float random, float mean) { return(-FloatMath.Log(1f - random) * mean); }