1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-20 18:50:21 +02:00

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.
This commit is contained in:
Andy Wingo 2021-12-13 11:42:17 +01:00
parent ccb78fc7b1
commit 9a358a9632
3 changed files with 154 additions and 119 deletions

View file

@ -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 */