From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: scm_difference big - -inum Date: Fri, 22 Aug 2003 11:18:33 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87wud64hhy.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1061545699 18393 80.91.224.253 (22 Aug 2003 09:48:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2003 09:48:19 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Aug 22 11:48:17 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19q8Wm-0000XW-00 for ; Fri, 22 Aug 2003 11:48:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19q8Jf-00053G-H7 for guile-devel@m.gmane.org; Fri, 22 Aug 2003 05:34:43 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19q6c5-0005JZ-My for guile-devel@gnu.org; Fri, 22 Aug 2003 03:45:37 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19q4Zc-0007Xq-P6 for guile-devel@gnu.org; Fri, 22 Aug 2003 01:35:27 -0400 Original-Received: from [61.8.0.36] (helo=snoopy.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.20) id 19q4Pv-0003Rr-7N for guile-devel@gnu.org; Fri, 22 Aug 2003 01:24:55 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.4) with ESMTP id h7M1J90J006360 for ; Fri, 22 Aug 2003 11:19:09 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h7M1J8kv000126 for ; Fri, 22 Aug 2003 11:19:09 +1000 (EST) Original-Received: from localhost (ppp54.dyn228.pacific.net.au [203.143.228.54]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h7M1Iqos028665 for ; Fri, 22 Aug 2003 11:19:00 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19q0ZX-0000zm-00; Fri, 22 Aug 2003 11:18:35 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2701 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2701 --=-=-= I fixed a bit of a gremlin in "-", * numbers.c (scm_difference): Correction to bignum - negative inum. * tests/numbers.test (-): Exercise bignum - inum. --=-=-= Content-Disposition: attachment; filename=numbers.c.big-sub-inum.diff --- numbers.c.~1.197.~ 2003-07-29 09:27:59.000000000 +1000 +++ numbers.c 2003-08-21 17:06:30.000000000 +1000 @@ -3370,7 +3370,10 @@ { SCM result = scm_i_mkbig (); - mpz_sub_ui (SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (x), yy); + if (yy >= 0) + mpz_sub_ui (SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (x), yy); + else + mpz_add_ui (SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (x), -yy); scm_remember_upto_here_1 (x); if ((sgn_x < 0 && (yy > 0)) || ((sgn_x > 0) && yy < 0)) --=-=-= Content-Disposition: attachment; filename=numbers.test.big-sub-inum.diff --- numbers.test.~1.30.~ 1970-01-01 10:00:01.000000000 +1000 +++ numbers.test 2003-08-21 17:07:04.000000000 +1000 @@ -1784,7 +1784,15 @@ (pass-if "-inum - +bignum" (= #x-100000000000000000000000000000001 - (- -1 #x100000000000000000000000000000000)))) + (- -1 #x100000000000000000000000000000000))) + + (pass-if "big - inum" + (= #xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + (- #x100000000000000000000000000000000 1))) + + (pass-if "big - -inum" + (= #x100000000000000000000000000000001 + (- #x100000000000000000000000000000000 -1)))) ;;; ;;; * --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--