From 09c1a959bdff9cdc0152638086b9e4a509d7c31c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 26 Jan 2011 04:34:55 -0500 Subject: [PATCH] Improve docs for `inf?' regarding non-real complex infinities * libguile/numbers.c: (scm_inf_p) Improve documentation string to mention that complex numbers with infinite real or imaginary part are also considered infinite. * doc/ref/api-data.texi (Real and Rational Numbers): Improve documentation for `inf?' to mention that complex numbers with infinite real or imaginary part are also considered infinite. --- doc/ref/api-data.texi | 5 +++-- libguile/numbers.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index b2c4b89..f2a03b3 100755 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -592,8 +592,9 @@ to use @code{inexact->exact} on the arguments. @deffn {Scheme Procedure} inf? x @deffnx {C Function} scm_inf_p (x) -Return @code{#t} if @var{x} is either @samp{+inf.0} or @samp{-inf.0}, -@code{#f} otherwise. +Return @code{#t} if @var{x} is @samp{+inf.0}, @samp{-inf.0}, or +a complex number whose real or imaginary part is infinite. +Otherwise return @code{#f}. @end deffn @deffn {Scheme Procedure} nan? x diff --git a/libguile/numbers.c b/libguile/numbers.c index 7b00ba9..a631ee4 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -618,8 +618,9 @@ SCM_DEFINE (scm_finite_p, "finite?", 1, 0, 0, SCM_DEFINE (scm_inf_p, "inf?", 1, 0, 0, (SCM x), - "Return @code{#t} if @var{x} is either @samp{+inf.0}\n" - "or @samp{-inf.0}, @code{#f} otherwise.") + "Return @code{#t} if @var{x} is @samp{+inf.0}, @samp{-inf.0},\n" + "or a complex number whose real or imaginary part is infinite.\n" + "Otherwise return @code{#f}.") #define FUNC_NAME s_scm_inf_p { if (SCM_REALP (x)) -- 1.5.6.5