mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Merge branch 'master' into development (@unpairedbracket, make sure I did this right)
Conflicts: src/main/java/mekanism/common/tile/TileEntityAdvancedElectricMachine.java src/main/java/mekanism/common/util/MekanismUtils.java
This commit is contained in:
commit
2fe4cf290d
7 files changed
+73
-34
No files matched your search
@@ -15,16 +15,18 @@ public class StatUtils
|
||||
|
||||
public static int inversePoisson(double mean)
|
||||
{
|
||||
double r = rand.nextDouble() * exp(mean);
|
||||
double r = rand.nextDouble()*exp(mean);
|
||||
int m = 0;
|
||||
double p = 1;
|
||||
double stirlingValue = mean * E;
|
||||
double stirlingCoeff = 1 / sqrt(2 * PI);
|
||||
while ((p < r) && (m < 3*ceil(mean)))
|
||||
double stirlingValue = mean*E;
|
||||
double stirlingCoeff = 1/sqrt(2*PI);
|
||||
|
||||
while((p < r) && (m < 3*ceil(mean)))
|
||||
{
|
||||
m ++;
|
||||
p += stirlingCoeff/sqrt(m) * pow((stirlingValue/m), m);
|
||||
m++;
|
||||
p += stirlingCoeff/sqrt(m)*pow((stirlingValue/m), m);
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user