From ec7c3c33081ae22af8043acbd619425139486ba8 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 18 Feb 2019 17:18:02 -0500 Subject: [PATCH] Revert change to (integer?) for now Causes unit test failures, need to sort this out separately. --- CHANGELOG.md | 7 +++++-- runtime.c | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4af2535d..1cf4e344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,12 @@ Bug Fixes - Fix from Petr Pražák to avoid compilation errors when using newer versions of LibTomMath. - Avoid cases where bignums are not initialized properly by the runtime and incorrectly retain a value of zero. -- Handle the following edge cases from R7RS: +- Handle the following edge case from R7RS: - > If `z` is a complex number, then `(real? z)` is true if and only if `(zero? (imag-part z))` is true. If `x` is an inexact real number, then `(integer? x)` is true if and only if `(= x (round x))`. + > If `z` is a complex number, then `(real? z)` is true if and only if `(zero? (imag-part z))` is true. + + +TBD: If `x` is an inexact real number, then `(integer? x)` is true if and only if `(= x (round x))`. ## 0.9.8 - February 16, 2019 diff --git a/runtime.c b/runtime.c index 456eaef9..8cacd2c5 100644 --- a/runtime.c +++ b/runtime.c @@ -1699,8 +1699,9 @@ object Cyc_is_integer(object o) { if ((o != NULL) && (obj_is_int(o) || (!is_value_type(o) && type_of(o) == integer_tag) || - (!is_value_type(o) && type_of(o) == bignum_tag) || - (!is_value_type(o) && type_of(o) == double_tag && double_value(o) == round(double_value(o))))) // Per R7RS + (!is_value_type(o) && type_of(o) == bignum_tag) + // || (!is_value_type(o) && type_of(o) == double_tag && double_value(o) == round(double_value(o))) + )) // Per R7RS return boolean_t; return boolean_f; }