add bigint display in GMP test
This commit is contained in:
parent
08ed81af34
commit
166a1075b1
|
@ -88,7 +88,7 @@ proc main() =
|
||||||
mpz_init(r)
|
mpz_init(r)
|
||||||
|
|
||||||
testRandomModSizes(100, aBits, mBits):
|
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
|
# Generate random value in the range 0 ..< 2^aBits
|
||||||
mpz_urandomb(a, gmpRng, aBits)
|
mpz_urandomb(a, gmpRng, aBits)
|
||||||
|
@ -96,6 +96,8 @@ proc main() =
|
||||||
mpz_urandomb(m, gmpRng, mBits)
|
mpz_urandomb(m, gmpRng, mBits)
|
||||||
mpz_setbit(m, mBits-1)
|
mpz_setbit(m, mBits-1)
|
||||||
|
|
||||||
|
discard gmp_printf(" -- %#Zx mod %#Zx\n", a.addr, m.addr)
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Conversion buffers
|
# Conversion buffers
|
||||||
const aLen = (aBits + 7) div 8
|
const aLen = (aBits + 7) div 8
|
||||||
|
|
Loading…
Reference in New Issue