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 /libguile/numbers.c | |
parent | b2c4c3e5e315c64a5978d1c5918e9063cd92ada8 (diff) |
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 'libguile/numbers.c')
-rw-r--r-- | libguile/numbers.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libguile/numbers.c b/libguile/numbers.c index b01af9f36..e34c60ef3 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -536,6 +536,11 @@ SCM_PRIMITIVE_GENERIC (scm_exact_p, "exact?", 1, 0, 0, } #undef FUNC_NAME +int +scm_is_exact (SCM val) +{ + return scm_is_true (scm_exact_p (val)); +} SCM_PRIMITIVE_GENERIC (scm_inexact_p, "inexact?", 1, 0, 0, (SCM x), @@ -552,6 +557,11 @@ SCM_PRIMITIVE_GENERIC (scm_inexact_p, "inexact?", 1, 0, 0, } #undef FUNC_NAME +int +scm_is_inexact (SCM val) +{ + return scm_is_true (scm_inexact_p (val)); +} SCM_PRIMITIVE_GENERIC (scm_odd_p, "odd?", 1, 0, 0, (SCM n), |