guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-85-ge3c15c


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-85-ge3c15cf
Date: Tue, 08 Mar 2011 22:51:37 +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=e3c15cf7a61ca79b67f510624cdc1631e3662b20

The branch, stable-2.0 has been updated
       via  e3c15cf7a61ca79b67f510624cdc1631e3662b20 (commit)
       via  18d78c5e3585b06e5f588ba1ae919e189afeaa73 (commit)
       via  4f1bbedb6db54acc0a0ceea81dc79220bbbcb1b3 (commit)
       via  73ea546c51c5ca531cc6040eb37e292a8334b33e (commit)
      from  831e6782bfa776c30286ef14f1356b9d5aa8f1ee (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 e3c15cf7a61ca79b67f510624cdc1631e3662b20
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 18d78c5e3585b06e5f588ba1ae919e189afeaa73
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 4f1bbedb6db54acc0a0ceea81dc79220bbbcb1b3
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 73ea546c51c5ca531cc6040eb37e292a8334b33e
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 95e71da..362a6e3 100644
--- a/doc/ref/goops.texi
+++ b/doc/ref/goops.texi
@@ -1104,9 +1104,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 c1ac541..8f89286 100644
--- a/doc/ref/r6rs.texi
+++ b/doc/ref/r6rs.texi
@@ -356,7 +356,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
@@ -542,11 +541,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]