This commit is contained in:
Iaroslav Postovalov 2021-08-19 03:24:54 +07:00
parent 3c6b068c39
commit bf9480219d

View File

@ -59,7 +59,7 @@ public object ZigguratNormalizedGaussianSampler : NormalizedGaussianSampler {
private fun sampleOne(generator: RandomGenerator): Double {
val j = generator.nextLong()
val i = (j and LAST.toLong()).toIntExact()
val i = (j and LAST.toLong()).toInt()
return if (abs(j) < K[i]) j * W[i] else fix(generator, j, i)
}