Skip to content

Commit f2a48e2

Browse files
committed
Made karatsuba treshold a global const
1 parent 244a6a8 commit f2a48e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bigints.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func initBigInt*(val: BigInt): BigInt =
6565
const
6666
zero = initBigInt(0)
6767
one = initBigInt(1)
68+
karatsubaTreshold = 5
6869

6970
func isZero(a: BigInt): bool {.inline.} =
7071
for i in countdown(a.limbs.high, 0):
@@ -451,7 +452,6 @@ func multiplication(a: var BigInt, b, c: BigInt) =
451452
let
452453
bl = b.limbs.len
453454
cl = c.limbs.len
454-
karatsubaTreshold = 5
455455

456456
if cl > bl:
457457
if bl <= karatsubaTreshold:

0 commit comments

Comments
 (0)