mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
Fix bytevectors VALIDATE_REAL to test for reals, not rationals
Reported and fixed by Daniel Llorens <dll@bluewin.ch>. * libguile/bytevectors.c (VALIDATE_REAL): Test for reals, not rationals. * test-suite/tests/srfi-4.test (f32 vectors, f64 vectors): Add tests.
This commit is contained in:
parent
0176bbb717
commit
ae255d65c3
2 changed files with 9 additions and 3 deletions
|
@ -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_real (v), v, pos, FUNC_NAME, "real"); \
|
||||
} while (0)
|
||||
|
||||
/* Templace getters and setters. */
|
||||
|
|
|
@ -352,7 +352,10 @@
|
|||
|
||||
(pass-if "make-f32vector"
|
||||
(equal? (list->f32vector '(7 7 7 7))
|
||||
(make-f32vector 4 7))))
|
||||
(make-f32vector 4 7)))
|
||||
|
||||
(pass-if "+inf.0, -inf.0, +nan.0 in f32vector"
|
||||
(f32vector? #f32(+inf.0 -inf.0 +nan.0))))
|
||||
|
||||
(with-test-prefix "f64 vectors"
|
||||
|
||||
|
@ -389,4 +392,7 @@
|
|||
|
||||
(pass-if "make-f64vector"
|
||||
(equal? (list->f64vector '(7 7 7 7))
|
||||
(make-f64vector 4 7))))
|
||||
(make-f64vector 4 7)))
|
||||
|
||||
(pass-if "+inf.0, -inf.0, +nan.0 in f64vector"
|
||||
(f64vector? #f64(+inf.0 -inf.0 +nan.0))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue