From 75b08a75a6861017c689cff0b3fc40cf89802a03 Mon Sep 17 00:00:00 2001 From: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:43:37 +0100 Subject: [PATCH] Simplify test task & possibly fix 32 bit (#60) --- bigints.nimble | 8 ++++---- src/bigints.nim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bigints.nimble b/bigints.nimble index 3ea2634..bdf798a 100644 --- a/bigints.nimble +++ b/bigints.nimble @@ -12,7 +12,7 @@ srcDir = "src" requires "nim >= 1.4.0" task test, "Test bigints": - exec "nim r --backend:c tests/tbigints.nim" - exec "nim r --backend:c tests/tbugs.nim" - exec "nim r --backend:cpp tests/tbigints.nim" - exec "nim r --backend:cpp tests/tbugs.nim" + for backend in ["c", "cpp"]: + echo "testing " & backend & " backend" + for file in ["tbigints.nim", "tbugs.nim"]: + exec "nim r --hints:off --backend:" & backend & " tests/" & file diff --git a/src/bigints.nim b/src/bigints.nim index 9dd7687..ca335c7 100644 --- a/src/bigints.nim +++ b/src/bigints.nim @@ -758,7 +758,7 @@ proc `divmod`*(a, b: BigInt): tuple[q, r: BigInt] = proc calcSizes(): array[2..36, int] = for i in 2..36: - var x = i + var x = int64(i) while x <= int64(uint32.high) + 1: x *= i result[i].inc