diff options
author | Mark H Weaver <mhw@netris.org> | 2011-02-13 05:47:33 -0500 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-02-14 20:30:30 +0100 |
commit | 5fbf680be9e98d005bbbd6a598443fca76a6918d (patch) | |
tree | ae29979fa50ef46b747fa59353ac4d1a1e0d92b4 /libguile/numbers.h | |
parent | a85c1f93f03e1de8f6a52a09b186e885c4c2f216 (diff) | |
download | guile-5fbf680be9e98d005bbbd6a598443fca76a6918d.tar.gz |
Make divide functions return values via (SCM *) output arguments
* libguile/numbers.c (scm_euclidean_divide, scm_centered_divide): Change
API to return two values via output arguments of type (SCM *), instead
of packing into a values object.
(scm_i_euclidean_divide, scm_i_centered_divide): New internal wrappers
that call the above functions and pack the result into a values
object.
* libguile/numbers.h: Change prototypes to reflect new API.
* doc/ref/api-data.h (Arithmetic): Update manual.
Diffstat (limited to 'libguile/numbers.h')
-rw-r--r-- | libguile/numbers.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libguile/numbers.h b/libguile/numbers.h index 10a4f170f..b8529a363 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -178,10 +178,10 @@ SCM_API SCM scm_abs (SCM x); SCM_API SCM scm_quotient (SCM x, SCM y); SCM_API SCM scm_remainder (SCM x, SCM y); SCM_API SCM scm_modulo (SCM x, SCM y); -SCM_API SCM scm_euclidean_divide (SCM x, SCM y); +SCM_API void scm_euclidean_divide (SCM x, SCM y, SCM *q, SCM *r); SCM_API SCM scm_euclidean_quotient (SCM x, SCM y); SCM_API SCM scm_euclidean_remainder (SCM x, SCM y); -SCM_API SCM scm_centered_divide (SCM x, SCM y); +SCM_API void scm_centered_divide (SCM x, SCM y, SCM *q, SCM *r); SCM_API SCM scm_centered_quotient (SCM x, SCM y); SCM_API SCM scm_centered_remainder (SCM x, SCM y); SCM_API SCM scm_gcd (SCM x, SCM y); @@ -199,6 +199,9 @@ SCM_API SCM scm_bit_extract (SCM n, SCM start, SCM end); SCM_API SCM scm_logcount (SCM n); SCM_API SCM scm_integer_length (SCM n); +SCM_INTERNAL SCM scm_i_euclidean_divide (SCM x, SCM y); +SCM_INTERNAL SCM scm_i_centered_divide (SCM x, SCM y); + SCM_INTERNAL SCM scm_i_gcd (SCM x, SCM y, SCM rest); SCM_INTERNAL SCM scm_i_lcm (SCM x, SCM y, SCM rest); SCM_INTERNAL SCM scm_i_logand (SCM x, SCM y, SCM rest); |