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

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)
}