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

Implement floor-quotient with new integer lib

* libguile/integers.c (scm_integer_floor_quotient_ii)
(scm_integer_floor_quotient_iz, scm_integer_floor_quotient_zi)
(scm_integer_floor_quotient_zz): New internal functions.
(long_to_scm, ulong_to_scm, take_bignum_from_mpz): New helpers.
* libguile/integers.h: Declare internal functions.
* libguile/numbers.c (scm_floor_quotient): Use the new functions.
This commit is contained in:
Andy Wingo 2021-12-03 22:34:09 +01:00
parent 44c654aa3e
commit 31da9be6c4
3 changed files with 92 additions and 67 deletions

View file

@ -29,6 +29,11 @@ SCM_INTERNAL int scm_is_integer_odd_z (SCM z);
SCM_INTERNAL SCM scm_integer_abs_i (scm_t_inum i);
SCM_INTERNAL SCM scm_integer_abs_z (SCM z);
SCM_INTERNAL SCM scm_integer_floor_quotient_ii (scm_t_inum x, scm_t_inum y);
SCM_INTERNAL SCM scm_integer_floor_quotient_iz (scm_t_inum x, SCM y);
SCM_INTERNAL SCM scm_integer_floor_quotient_zi (SCM x, scm_t_inum y);
SCM_INTERNAL SCM scm_integer_floor_quotient_zz (SCM x, SCM y);
#endif /* SCM_INTEGERS_H */