Fix #408 #409

Merged
CommanderTvis merged 1 commits from commandertvis/issue408 into dev 2021-08-19 12:44:33 +03:00

View File

@ -59,7 +59,7 @@ public object ZigguratNormalizedGaussianSampler : NormalizedGaussianSampler {
private fun sampleOne(generator: RandomGenerator): Double { private fun sampleOne(generator: RandomGenerator): Double {
val j = generator.nextLong() 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) return if (abs(j) < K[i]) j * W[i] else fix(generator, j, i)
} }