Change Randoms.getProbability to use doubles.
Existing callers will merrily promote up, and this way we can match the results over in the actionscript port in aspirin.
This commit is contained in:
@@ -106,9 +106,9 @@ public class Randoms
|
|||||||
/**
|
/**
|
||||||
* Has a probability <code>p</code> of returning true.
|
* Has a probability <code>p</code> of returning true.
|
||||||
*/
|
*/
|
||||||
public boolean getProbability (float p)
|
public boolean getProbability (double p)
|
||||||
{
|
{
|
||||||
return _r.nextFloat() < p;
|
return _r.nextDouble() < p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user