Karatsuba added, 2 bugs are fixed #328
@ -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)
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user