From 1a615c503d4fd337474d761485ecdc285d681c83 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 14 May 2021 09:20:49 +0300 Subject: [PATCH] re-apply bigint fix --- .../space/kscience/kmath/operations/algebraExtensions.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/algebraExtensions.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/algebraExtensions.kt index 9691c9d17..830c504f3 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/algebraExtensions.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/algebraExtensions.kt @@ -108,9 +108,9 @@ public fun Sequence.averageWith(space: S): T where S : Ring, S : Sc * @author Evgeniy Zhelenskiy */ public fun Ring.power(arg: T, power: UInt): T = when { - this == zero && power > 0U -> zero - this == one -> arg - this == -one -> powWithoutOptimization(arg, power % 2U) + arg == zero && power > 0U -> zero + arg == one -> arg + arg == -one -> powWithoutOptimization(arg, power % 2U) else -> powWithoutOptimization(arg, power) }