diff options
author | Mike Gran <spk121@yahoo.com> | 2011-10-09 20:54:37 -0700 |
---|---|---|
committer | Mike Gran <spk121@yahoo.com> | 2011-10-09 20:54:37 -0700 |
commit | 022dda690126d993d82644efeffada1a1ef41123 (patch) | |
tree | 5e81d7fddecf9d45c3781a356167b8227b115c25 /doc/ref/api-data.texi | |
parent | b2c4c3e5e315c64a5978d1c5918e9063cd92ada8 (diff) | |
download | guile-022dda690126d993d82644efeffada1a1ef41123.tar.gz |
New functions scm_is_exact and scm_is_inexact
* doc/ref/api-data.texi (Exact and Inexact Numbers): doc for scm_is_exact
and scm_is_inexact
* libguile/numbers.c (scm_is_exact, scm_is_inexact): new functions
* libguile/numbers.h: declarations for scm_is_exact and scm_is_inexact
* test/suite/standalone/test-conversion.c (test_is_exact, test_is_inexact):
new tests
Diffstat (limited to 'doc/ref/api-data.texi')
-rw-r--r-- | doc/ref/api-data.texi | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index 9825bef86..f9b39b61d 100644 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -747,12 +747,25 @@ otherwise. @end deffn +@deftypefn {C Function} int scm_is_exact (SCM z) +Return a @code{1} if the number @var{z} is exact, and @code{0} +otherwise. This is equivalent to @code{scm_is_true (scm_exact_p (z))}. + +An alternate approch to testing the exactness of a number is to +use @code{scm_is_signed_integer} or @code{scm_is_unsigned_integer}. +@end deftypefn + @deffn {Scheme Procedure} inexact? z @deffnx {C Function} scm_inexact_p (z) Return @code{#t} if the number @var{z} is inexact, @code{#f} else. @end deffn +@deftypefn {C Function} int scm_is_inexact (SCM z) +Return a @code{1} if the number @var{z} is inexact, and @code{0} +otherwise. This is equivalent to @code{scm_is_true (scm_inexact_p (z))}. +@end deftypefn + @deffn {Scheme Procedure} inexact->exact z @deffnx {C Function} scm_inexact_to_exact (z) Return an exact number that is numerically closest to @var{z}, when |