1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

scm_to_mpz uses integer lib

* libguile/integers.h:
* libguile/integers.c (scm_integer_to_mpz_z): New internal function.
* libguile/numbers.c (scm_to_mpz): Use new function.
This commit is contained in:
Andy Wingo 2022-01-06 21:47:20 +01:00
parent debcccc215
commit 9a91c20a55
3 changed files with 12 additions and 2 deletions

View file

@ -3035,3 +3035,12 @@ scm_integer_to_uint64_z (struct scm_bignum *z, uint64_t *val)
{
return bignum_to_uint64 (z, val);
}
void
scm_integer_to_mpz_z (struct scm_bignum *z, mpz_t n)
{
mpz_t zn;
alias_bignum_to_mpz (z, zn);
mpz_init_set (n, zn);
scm_remember_upto_here_1 (z);
}