[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-15-132-g5
From: |
Mark H Weaver |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-15-132-g5d34402 |
Date: |
Tue, 08 Mar 2011 22:53:13 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=5d344028fbf8b3e764549d975b20aa20ae316aa9
The branch, master has been updated
via 5d344028fbf8b3e764549d975b20aa20ae316aa9 (commit)
via 0655c9eb290002097f840f7d543875d6c93df089 (commit)
via 7d185392ce51656f50904aa71b1ed5019584f842 (commit)
via ae255d65c39de0532df1a2b1da7a14d94e5e3bc6 (commit)
from 0176bbb71705434f3fbbfe67cd00a7ae3d7cf079 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5d344028fbf8b3e764549d975b20aa20ae316aa9
Author: Mark H Weaver <address@hidden>
Date: Tue Mar 1 13:46:08 2011 -0500
Remove incorrect footnote from GOOPS manual
* doc/ref/goops.texi (Inheritance): Remove footnote which incorrectly
stated that <complex> was not shown in the class hierarchy figure.
commit 0655c9eb290002097f840f7d543875d6c93df089
Author: Mark H Weaver <address@hidden>
Date: Tue Feb 22 21:39:37 2011 -0500
Update comments regarding GMP earlier than 4.2.
* libguile/numbers.c: Update comments regarding GMP earlier than 4.2.
Remove speculations about versions of GMP that had not yet been
released when the comments were written. Replace them with facts that
are now known about the changes made in GMP 4.2.
commit 7d185392ce51656f50904aa71b1ed5019584f842
Author: Mark H Weaver <address@hidden>
Date: Tue Mar 1 12:37:01 2011 -0500
Fix description of the R6RS `finite?' in manual
* doc/ref/r6rs.texi (rnrs base): `(finite? x)' returns true iff x is
neither infinite nor a NaN. Previously, it stated that `finite?' was
the negation of `infinite?', which was incorrect because NaNs are
neither finite nor infinite. Combine description of 'nan?' with those
of `finite?' and `infinite?'.
commit ae255d65c39de0532df1a2b1da7a14d94e5e3bc6
Author: Mark H Weaver <address@hidden>
Date: Tue Mar 1 12:46:38 2011 -0500
Fix bytevectors VALIDATE_REAL to test for reals, not rationals
Reported and fixed by Daniel Llorens <address@hidden>.
* libguile/bytevectors.c (VALIDATE_REAL): Test for reals, not rationals.
* test-suite/tests/srfi-4.test (f32 vectors, f64 vectors): Add tests.
-----------------------------------------------------------------------
Summary of changes:
doc/ref/goops.texi | 4 +---
doc/ref/r6rs.texi | 13 ++++++++-----
libguile/bytevectors.c | 2 +-
libguile/numbers.c | 32 ++++++++++++++++++--------------
test-suite/tests/srfi-4.test | 10 ++++++++--
5 files changed, 36 insertions(+), 25 deletions(-)
diff --git a/doc/ref/goops.texi b/doc/ref/goops.texi
index 3bebd8f..452c88b 100644
--- a/doc/ref/goops.texi
+++ b/doc/ref/goops.texi
@@ -1085,9 +1085,7 @@ Those class definitions define a hierarchy which is shown
in
@ref{fig:hier}. In this figure, the class @code{<top>} is also shown;
this class is the superclass of all Scheme objects. In particular,
@code{<top>} is the superclass of all standard Scheme
address@hidden@code{<complex>}, which is the direct subclass of
address@hidden<number>} and the direct superclass of @code{<real>}, has been
-omitted in this figure.}
+types.
@float Figure,fig:hier
@iftex
diff --git a/doc/ref/r6rs.texi b/doc/ref/r6rs.texi
index 0fb87d1..72a3f34 100644
--- a/doc/ref/r6rs.texi
+++ b/doc/ref/r6rs.texi
@@ -355,7 +355,6 @@ grouped below by the existing manual sections to which they
correspond.
@deffn {Scheme Procedure} real? x
@deffnx {Scheme Procedure} rational? x
address@hidden {Scheme Procedure} nan? x
@deffnx {Scheme Procedure} numerator x
@deffnx {Scheme Procedure} denominator x
@deffnx {Scheme Procedure} rationalize x eps
@@ -541,11 +540,15 @@ loss of numerical precision.
imaginary parts are zero.
@end deffn
address@hidden {Scheme Procedure} finite? x
address@hidden {Scheme Procedure} nan? x
@deffnx {Scheme Procedure} infinite? x
address@hidden returns @code{#t} if @var{x} is an infinite value,
address@hidden otherwise. @code{finite?} returns the negation of
address@hidden
address@hidden {Scheme Procedure} finite? x
address@hidden returns @code{#t} if @var{x} is a NaN value, @code{#f}
+otherwise. @code{infinite?} returns @code{#t} if @var{x} is an infinite
+value, @code{#f} otherwise. @code{finite?} returns @code{#t} if @var{x}
+is neither infinite nor a NaN value, otherwise it returns @code{#f}.
+Every real number satisfies exactly one of these predicates. An
+exception is raised if @var{x} is not real.
@end deffn
@deffn {Scheme Syntax} assert expr
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index f014697..a969e3b 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_real (v), v, pos, FUNC_NAME, "real"); \
} while (0)
/* Templace getters and setters. */
diff --git a/libguile/numbers.c b/libguile/numbers.c
index b8cfa5d..be86eb5 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -134,9 +134,9 @@ static double acosh (double x) { return log (x + sqrt (x *
x - 1)); }
static double atanh (double x) { return 0.5 * log ((1 + x) / (1 - x)); }
#endif
-/* mpz_cmp_d in gmp 4.1.3 doesn't recognise infinities, so xmpz_cmp_d uses
- an explicit check. In some future gmp (don't know what version number),
- mpz_cmp_d is supposed to do this itself. */
+/* mpz_cmp_d in GMP before 4.2 didn't recognise infinities, so
+ xmpz_cmp_d uses an explicit check. Starting with GMP 4.2 (released
+ in March 2006), mpz_cmp_d now handles infinities properly. */
#if 1
#define xmpz_cmp_d(z, d) \
(isinf (d) ? (d < 0.0 ? 1 : -1) : mpz_cmp_d (z, d))
@@ -316,16 +316,15 @@ scm_i_dbl2num (double u)
we need to use mpz_getlimbn. mpz_tstbit is not right, it treats
negatives as twos complement.
- In current gmp 4.1.3, mpz_get_d rounding is unspecified. It ends up
- following the hardware rounding mode, but applied to the absolute value
- of the mpz_t operand. This is not what we want so we put the high
- DBL_MANT_DIG bits into a temporary. In some future gmp, don't know when,
- mpz_get_d is supposed to always truncate towards zero.
+ In GMP before 4.2, mpz_get_d rounding was unspecified. It ended up
+ following the hardware rounding mode, but applied to the absolute
+ value of the mpz_t operand. This is not what we want so we put the
+ high DBL_MANT_DIG bits into a temporary. Starting with GMP 4.2
+ (released in March 2006) mpz_get_d now always truncates towards zero.
- ENHANCE-ME: The temporary init+clear to force the rounding in gmp 4.1.3
- is a slowdown. It'd be faster to pick out the relevant high bits with
- mpz_getlimbn if we could be bothered coding that, and if the new
- truncating gmp doesn't come out. */
+ ENHANCE-ME: The temporary init+clear to force the rounding in GMP
+ before 4.2 is a slowdown. It'd be faster to pick out the relevant
+ high bits with mpz_getlimbn. */
double
scm_i_big2dbl (SCM b)
@@ -337,7 +336,12 @@ scm_i_big2dbl (SCM b)
#if 1
{
- /* Current GMP, eg. 4.1.3, force truncation towards zero */
+ /* For GMP earlier than 4.2, force truncation towards zero */
+
+ /* FIXME: DBL_MANT_DIG is the number of base-`FLT_RADIX' digits,
+ _not_ the number of bits, so this code will break badly on a
+ system with non-binary doubles. */
+
mpz_t tmp;
if (bits > DBL_MANT_DIG)
{
@@ -353,7 +357,7 @@ scm_i_big2dbl (SCM b)
}
}
#else
- /* Future GMP */
+ /* GMP 4.2 or later */
result = mpz_get_d (SCM_I_BIG_MPZ (b));
#endif
diff --git a/test-suite/tests/srfi-4.test b/test-suite/tests/srfi-4.test
index d7e5b1a..0cdfb66 100644
--- a/test-suite/tests/srfi-4.test
+++ b/test-suite/tests/srfi-4.test
@@ -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))))
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-15-132-g5d34402,
Mark H Weaver <=