unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Broken VALIDATE_REAL in master
@ 2011-03-01  8:52 Daniel Llorens
  2011-03-01 19:17 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Llorens @ 2011-03-01  8:52 UTC (permalink / raw)
  To: guile-devel


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))))




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-01 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-01  8:52 Broken VALIDATE_REAL in master Daniel Llorens
2011-03-01 19:17 ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).