Karatsuba added, 2 bugs are fixed #328

Merged
zhelenskiy merged 15 commits from dev into dev 2021-05-14 09:12:26 +03:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit 1e71f29d5e - Show all commits

View File

@ -32,6 +32,16 @@ internal class BigIntBenchmark {
blackhole.consume(jvmNumber + jvmNumber + jvmNumber)
}
@Benchmark
fun kmAddLarge(blackhole: Blackhole) = BigIntField {
blackhole.consume(largeKmNumber + largeKmNumber + largeKmNumber)
}
@Benchmark
fun jvmAddLarge(blackhole: Blackhole) = JBigIntegerField {
blackhole.consume(largeJvmNumber + largeJvmNumber + largeJvmNumber)
}
@Benchmark
fun kmMultiply(blackhole: Blackhole) = BigIntField {
blackhole.consume(kmNumber * kmNumber * kmNumber)

View File

@ -281,7 +281,7 @@ public class BigInt internal constructor(
}
result[i] = (res and BASE).toUInt()
carry = (res shr BASE_SIZE)
carry = res shr BASE_SIZE
}
result[resultLength - 1] = carry.toUInt()