From 0b90dd4df25a34f48b7446341d64ad85534b2281 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Thu, 19 Aug 2021 03:24:54 +0700 Subject: [PATCH] Fix #408 --- .../kmath/samplers/ZigguratNormalizedGaussianSampler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmath-stat/src/commonMain/kotlin/space/kscience/kmath/samplers/ZigguratNormalizedGaussianSampler.kt b/kmath-stat/src/commonMain/kotlin/space/kscience/kmath/samplers/ZigguratNormalizedGaussianSampler.kt index 2d5750bc7..bda6f9819 100644 --- a/kmath-stat/src/commonMain/kotlin/space/kscience/kmath/samplers/ZigguratNormalizedGaussianSampler.kt +++ b/kmath-stat/src/commonMain/kotlin/space/kscience/kmath/samplers/ZigguratNormalizedGaussianSampler.kt @@ -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) }