diff options
author | Andy Wingo <wingo@pobox.com> | 2021-12-13 11:42:17 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2022-01-13 09:37:16 +0100 |
commit | 9a358a9632f6ef9c58f4d080389cd8bd4c9b0edc (patch) | |
tree | b8389e163dd1020849e221721084b30c829567f4 /libguile/integers.h | |
parent | ccb78fc7b171d1f2bf1f6eeb9e4cffcea318a838 (diff) | |
download | guile-9a358a9632f6ef9c58f4d080389cd8bd4c9b0edc.tar.gz |
Implement round-quotient with new integer lib
* libguile/integers.c (scm_integer_round_quotient_ii)
(scm_integer_round_quotient_iz, scm_integer_round_quotient_zi)
(scm_integer_round_quotient_zz): New internal functions.
(integer_round_quotient_zz): New helper.
(long_sign, bignum_cmp_long): New helpers.
* libguile/integers.h: Declare internal functions.
* libguile/numbers.c (scm_round_quotient): Use the new functions.
(scm_i_bigint_round_quotient): Remove unused helper.
Diffstat (limited to 'libguile/integers.h')
-rw-r--r-- | libguile/integers.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libguile/integers.h b/libguile/integers.h index f941eefc6..dcbc32a10 100644 --- a/libguile/integers.h +++ b/libguile/integers.h @@ -105,6 +105,11 @@ SCM_INTERNAL void scm_integer_centered_divide_zi (SCM x, scm_t_inum y, SCM_INTERNAL void scm_integer_centered_divide_zz (SCM x, SCM y, SCM *qp, SCM *rp); +SCM_INTERNAL SCM scm_integer_round_quotient_ii (scm_t_inum x, scm_t_inum y); +SCM_INTERNAL SCM scm_integer_round_quotient_iz (scm_t_inum x, SCM y); +SCM_INTERNAL SCM scm_integer_round_quotient_zi (SCM x, scm_t_inum y); +SCM_INTERNAL SCM scm_integer_round_quotient_zz (SCM x, SCM y); + #endif /* SCM_INTEGERS_H */ |