Skip to content

Commit 920647b

Browse files
authored
Merge pull request #37 from ionspin/fix-constant-two
Fix BigInteger.TWO invalid value
2 parents 5bb1cc3 + 6c5180d commit 920647b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
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/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)