Skip to content

Commit a27ced0

Browse files
committed
Fix wrong value for constant TWO in biginteger and linkedlist implementation
1 parent 876ddda commit a27ced0

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
build/
88
/captures
99
/bignum/node_modules
10+
/bignum/package.json
1011
gradle.properties
1112
/buildSrc/out
1213
/bignum/node_modules

bignum/package.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

bignum/src/commonMain/kotlin/com/ionspin/kotlin/bignum/integer/BigInteger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class BigInteger internal constructor(wordArray: WordArray, val sign: Sign) : Bi
8989

9090
val ZERO = BigInteger(arithmetic.ZERO, Sign.ZERO)
9191
val ONE = BigInteger(arithmetic.ONE, Sign.POSITIVE)
92-
val TWO = BigInteger(arithmetic.ONE, Sign.POSITIVE)
92+
val TWO = BigInteger(arithmetic.TWO, Sign.POSITIVE)
9393
val TEN = BigInteger(arithmetic.TEN, Sign.POSITIVE)
9494

9595
val LOG_10_OF_2 = log10(2.0)

bignum/src/commonMain/kotlin/com/ionspin/kotlin/bignum/integer/base63/BigInteger63LinkedListArithmetic.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import kotlin.math.floor
4545
internal object BigInteger63LinkedListArithmetic : BigIntegerArithmetic<List<ULong>, ULong> {
4646
override val ZERO: List<ULong> = listOf(0u)
4747
override val ONE: List<ULong> = listOf(1u)
48-
override val TWO: List<ULong> = listOf(1u)
48+
override val TWO: List<ULong> = listOf(2u)
4949
override val TEN: List<ULong> = listOf(10UL)
5050
override val basePowerOfTwo: Int = 63
5151

0 commit comments

Comments
 (0)