[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Broken VALIDATE_REAL in master
From: |
Daniel Llorens |
Subject: |
Broken VALIDATE_REAL in master |
Date: |
Tue, 1 Mar 2011 09:52:08 +0100 |
Such things as
#f64(+inf.0)
fail.
Attached a fix. I tried to look into SCM_VALIDATE_REAL per the comment, I
didn't get far.
Regards,
Daniel
—
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index f014697..cc50e25 100644
--- a/libguile/bytevectors.c
+++ b/libguile/bytevectors.c
@@ -1667,7 +1667,7 @@ double_from_foreign_endianness (const union
scm_ieee754_double *source)
/* FIXME: SCM_VALIDATE_REAL rejects integers, etc. grrr */
#define VALIDATE_REAL(pos, v) \
do { \
- SCM_ASSERT_TYPE (scm_is_true (scm_rational_p (v)), v, pos, FUNC_NAME,
"real"); \
+ SCM_ASSERT_TYPE (scm_is_true (scm_real_p (v)), v, pos, FUNC_NAME, "real");
\
} while (0)
/* Templace getters and setters. */
diff --git a/test-suite/tests/srfi-4.test b/test-suite/tests/srfi-4.test
index d7e5b1a..a16880f 100644
--- a/test-suite/tests/srfi-4.test
+++ b/test-suite/tests/srfi-4.test
@@ -389,4 +389,7 @@
(pass-if "make-f64vector"
(equal? (list->f64vector '(7 7 7 7))
- (make-f64vector 4 7))))
+ (make-f64vector 4 7)))
+
+ (pass-if "+inf.0, +nan.0 in f64vector"
+ (f64vector? #f64(+inf.0 +nan.0))))
- Broken VALIDATE_REAL in master,
Daniel Llorens <=