forked from kscience/kmath
Large addition tests added
This commit is contained in:
parent
ded01251d1
commit
1e71f29d5e
@ -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