Added getFloat().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@855 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: RandomUtil.java,v 1.2 2001/12/14 16:46:01 shaper Exp $
|
// $Id: RandomUtil.java,v 1.3 2002/01/15 18:05:01 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.media.util;
|
package com.threerings.media.util;
|
||||||
|
|
||||||
@@ -24,6 +24,15 @@ public class RandomUtil
|
|||||||
return _rnd.nextInt(high);
|
return _rnd.nextInt(high);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pseudorandom, uniformly distributed float value between
|
||||||
|
* 0.0 (inclusive) and the specified value (inclusive).
|
||||||
|
*/
|
||||||
|
public static float getFloat (float high)
|
||||||
|
{
|
||||||
|
return _rnd.nextFloat() * high;
|
||||||
|
}
|
||||||
|
|
||||||
/** The random object from which we choose random numbers. */
|
/** The random object from which we choose random numbers. */
|
||||||
protected static Random _rnd = new Random();
|
protected static Random _rnd = new Random();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user