mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-03 16:20:39 +02:00
Add scm_integer_size_z to internal integers.h
* libguile/integers.c (scm_integer_size_z): * libguile/integers.h: Voilà.
This commit is contained in:
parent
1eedd208fb
commit
c18e93ef04
2 changed files with 8 additions and 1 deletions
|
@ -479,6 +479,12 @@ scm_integer_from_mpz (const mpz_t mpz)
|
|||
return normalize_bignum (make_bignum_from_mpz (mpz));
|
||||
}
|
||||
|
||||
size_t
|
||||
scm_integer_size_z (struct scm_bignum *z)
|
||||
{
|
||||
return sizeof (*z) + bignum_limb_count (z) * sizeof (mp_limb_t);
|
||||
}
|
||||
|
||||
int
|
||||
scm_is_integer_odd_i (scm_t_inum i)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef SCM_INTEGERS_H
|
||||
#define SCM_INTEGERS_H
|
||||
|
||||
/* Copyright 2021, 2022 Free Software Foundation, Inc.
|
||||
/* Copyright 2021, 2022, 2025 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Guile.
|
||||
|
||||
|
@ -35,6 +35,7 @@ scm_bignum (SCM x)
|
|||
SCM_INTERNAL SCM scm_integer_from_mpz (const mpz_t n);
|
||||
SCM_INTERNAL void scm_integer_set_mpz_z (struct scm_bignum *z, mpz_t n);
|
||||
SCM_INTERNAL void scm_integer_init_set_mpz_z (struct scm_bignum *z, mpz_t n);
|
||||
SCM_INTERNAL size_t scm_integer_size_z (struct scm_bignum *z);
|
||||
|
||||
SCM_INTERNAL int scm_is_integer_odd_i (scm_t_inum i);
|
||||
SCM_INTERNAL int scm_is_integer_odd_z (struct scm_bignum *z);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue