add bigint display in GMP test

This commit is contained in:
Mamy André-Ratsimbazafy 2020-02-09 23:26:39 +01:00
parent 08ed81af34
commit 166a1075b1
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
1 changed files with 3 additions and 1 deletions

View File

@ -88,7 +88,7 @@ proc main() =
mpz_init(r)
testRandomModSizes(100, aBits, mBits):
echo "Testing: Dividend bitsize " & align($aBits, 4) & " -- modulus bitsize " & align($mBits, 4)
stdout.write "Testing: Dividend bitsize " & align($aBits, 4) & " -- modulus bitsize " & align($mBits, 4)
# Generate random value in the range 0 ..< 2^aBits
mpz_urandomb(a, gmpRng, aBits)
@ -96,6 +96,8 @@ proc main() =
mpz_urandomb(m, gmpRng, mBits)
mpz_setbit(m, mBits-1)
discard gmp_printf(" -- %#Zx mod %#Zx\n", a.addr, m.addr)
#########################################################
# Conversion buffers
const aLen = (aBits + 7) div 8