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-87-gddf134


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-87-gddf134c
Date: Tue, 08 Mar 2011 23:19:33 +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=ddf134cfec0d82ea9f39ddd69948c08feecb9576

The branch, stable-2.0 has been updated
       via  ddf134cfec0d82ea9f39ddd69948c08feecb9576 (commit)
       via  495a39c40f8c31479272495c3a550695077ac335 (commit)
      from  e3c15cf7a61ca79b67f510624cdc1631e3662b20 (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 ddf134cfec0d82ea9f39ddd69948c08feecb9576
Author: Mark H Weaver <address@hidden>
Date:   Fri Mar 4 13:44:02 2011 -0500

    Within `while', `continue' takes zero arguments
    
    * module/ice-9/boot-9.scm (while): Report an error if `continue' is
      passed one or more arguments.  Previously, it would report an error if
      `(continue arg rest ...)' was found within the `while', but not if
      `continue' was found bare and later applied to one or more arguments,
      e.g. `(apply continue (list arg rest ...))'.

commit 495a39c40f8c31479272495c3a550695077ac335
Author: Mark H Weaver <address@hidden>
Date:   Sun Mar 6 20:27:40 2011 -0500

    Quotient, remainder and modulo accept inexact integers
    
    * libguile/numbers.c (scm_quotient, scm_remainder, scm_modulo): Accept
      inexact integers as well as exact ones, as required by the R5RS.
    
    * test-suite/tests/numbers.test (quotient, remainder, modulo): Add tests.

-----------------------------------------------------------------------

Summary of changes:
 libguile/numbers.c            |   12 ++++++------
 module/ice-9/boot-9.scm       |    4 ++--
 test-suite/tests/numbers.test |   18 ++++++++++++++++++
 3 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/libguile/numbers.c b/libguile/numbers.c
index be86eb5..f8891fa 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -796,9 +796,9 @@ SCM_PRIMITIVE_GENERIC (scm_quotient, "quotient", 2, 0, 0,
        "Return the quotient of the numbers @var{x} and @var{y}.")
 #define FUNC_NAME s_scm_quotient
 {
-  if (SCM_LIKELY (SCM_I_INUMP (x)) || SCM_LIKELY (SCM_BIGP (x)))
+  if (SCM_LIKELY (scm_is_integer (x)))
     {
-      if (SCM_LIKELY (SCM_I_INUMP (y)) || SCM_LIKELY (SCM_BIGP (y)))
+      if (SCM_LIKELY (scm_is_integer (y)))
        return scm_truncate_quotient (x, y);
       else
        SCM_WTA_DISPATCH_2 (g_scm_quotient, x, y, SCM_ARG2, s_scm_quotient);
@@ -817,9 +817,9 @@ SCM_PRIMITIVE_GENERIC (scm_remainder, "remainder", 2, 0, 0,
        "@end lisp")
 #define FUNC_NAME s_scm_remainder
 {
-  if (SCM_LIKELY (SCM_I_INUMP (x)) || SCM_LIKELY (SCM_BIGP (x)))
+  if (SCM_LIKELY (scm_is_integer (x)))
     {
-      if (SCM_LIKELY (SCM_I_INUMP (y)) || SCM_LIKELY (SCM_BIGP (y)))
+      if (SCM_LIKELY (scm_is_integer (y)))
        return scm_truncate_remainder (x, y);
       else
        SCM_WTA_DISPATCH_2 (g_scm_remainder, x, y, SCM_ARG2, s_scm_remainder);
@@ -839,9 +839,9 @@ SCM_PRIMITIVE_GENERIC (scm_modulo, "modulo", 2, 0, 0,
        "@end lisp")
 #define FUNC_NAME s_scm_modulo
 {
-  if (SCM_LIKELY (SCM_I_INUMP (x)) || SCM_LIKELY (SCM_BIGP (x)))
+  if (SCM_LIKELY (scm_is_integer (x)))
     {
-      if (SCM_LIKELY (SCM_I_INUMP (y)) || SCM_LIKELY (SCM_BIGP (y)))
+      if (SCM_LIKELY (scm_is_integer (y)))
        return scm_floor_remainder (x, y);
       else
        SCM_WTA_DISPATCH_2 (g_scm_modulo, x, y, SCM_ARG2, s_scm_modulo);
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 7ca0806..a0b207c 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -2803,8 +2803,8 @@ module '(ice-9 q) '(make-q q-length))}."
                          ((_ . args)
                           (syntax-violation 'continue "too many arguments" x))
                          (_
-                          #'(lambda args 
-                              (apply abort-to-prompt continue-tag args))))))
+                          #'(lambda ()
+                              (abort-to-prompt continue-tag))))))
                    (do () ((not cond)) body ...))
                  (lambda (k) (lp)))))
             (lambda (k)
diff --git a/test-suite/tests/numbers.test b/test-suite/tests/numbers.test
index cb582ed..9584294 100644
--- a/test-suite/tests/numbers.test
+++ b/test-suite/tests/numbers.test
@@ -633,6 +633,12 @@
     (pass-if "n = fixnum-min - 1"
       (eqv? 1 (quotient (- fixnum-min 1) (- fixnum-min 1)))))
   
+  ;; Inexact integers
+
+  (pass-if (eqv? 5.0 (quotient 35.0 7.0)))
+  (pass-if (eqv? 5.0 (quotient 35   7.0)))
+  (pass-if (eqv? 5.0 (quotient 35.0 7  )))
+
   ;; Positive dividend and divisor
 
   (pass-if "35 / 7"
@@ -826,6 +832,12 @@
     (pass-if "n = fixnum-min - 1"
       (eqv? 0 (remainder (- fixnum-min 1) (- fixnum-min 1)))))
 
+  ;; Inexact integers
+
+  (pass-if (eqv? 2.0 (remainder 37.0 7.0)))
+  (pass-if (eqv? 2.0 (remainder 37   7.0)))
+  (pass-if (eqv? 2.0 (remainder 37.0 7  )))
+
   ;; Positive dividend and divisor
 
   (pass-if "35 / 7"
@@ -1009,6 +1021,12 @@
     (pass-if "n = fixnum-min - 1"
       (eqv? 0 (modulo (- fixnum-min 1) (- fixnum-min 1)))))
 
+  ;; Inexact integers
+
+  (pass-if (eqv? 1.0 (modulo 13.0 4.0)))
+  (pass-if (eqv? 1.0 (modulo 13   4.0)))
+  (pass-if (eqv? 1.0 (modulo 13.0 4  )))
+
   ;; Positive dividend and divisor
 
   (pass-if "13 % 4"


hooks/post-receive
-- 
GNU Guile



reply via email to

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