From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bill Schottstaedt Newsgroups: gmane.lisp.guile.devel Subject: Re: ratio implementation Date: Mon, 13 Oct 2003 03:58:05 -0700 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <3F8A853D.1020708@ccrma> References: <3F250809.9030108@ccrma.stanford.edu> <87smmyibk7.fsf@zagadka.ping.de> <3F6637EC.7010004@dirk-herrmanns-seiten.de> <3F66F68B.3070100@ccrma.stanford.edu> <3F6A1F1A.8000507@dirk-herrmanns-seiten.de> <87pth9cbmt.fsf@zagadka.ping.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1066042883 9149 80.91.224.253 (13 Oct 2003 11:01:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Oct 2003 11:01:23 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Oct 13 13:01:21 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 1A90S1-0002C0-00 for ; Mon, 13 Oct 2003 13:01:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A90Q2-0002Pv-9d for guile-devel@m.gmane.org; Mon, 13 Oct 2003 06:59:18 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A90Pq-0002P4-Is for guile-devel@gnu.org; Mon, 13 Oct 2003 06:59:06 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A90PC-0002HX-VA for guile-devel@gnu.org; Mon, 13 Oct 2003 06:58:57 -0400 Original-Received: from [171.67.16.34] (helo=smtp7.Stanford.EDU) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A90PB-0002H0-Tj for guile-devel@gnu.org; Mon, 13 Oct 2003 06:58:26 -0400 Original-Received: from cm-mail.stanford.edu (cm-mail.Stanford.EDU [171.64.197.135]) by smtp7.Stanford.EDU (8.12.10/8.12.10) with ESMTP id h9DAwFas026245; Mon, 13 Oct 2003 03:58:15 -0700 (PDT) Original-Received: from ccrma (cmn13.stanford.edu [171.64.197.162]) by cm-mail.stanford.edu (8.11.6/8.11.6) with ESMTP id h9DAw9915562; Mon, 13 Oct 2003 03:58:14 -0700 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en Original-To: Marius Vollmer In-Reply-To: <87pth9cbmt.fsf@zagadka.ping.de> 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:2870 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2870 I made the requested changes (using the Oct-9 CVS Guile): ftp://ccrma-ftp.stanford.edu/pub/Lisp/gratio-1.tar.gz I haven't yet translated the test suite to Guile's form. I notice that Guile doesn't support "exact complex", but it appears that some other Schemes do -- is this a desired extension? guile> (exact? 2/3+i) #f Under scm_ash, the doc string: "Formally, the function returns an integer equivalent to\n" "@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.\n" is incorrect: guile> (ash .1 2) 0.4 but ash is not handling negative shifts correctly: guile> (ash .1 -2) Backtrace: In standard input: 4: 0* [ash 0.1 -2] standard input:4:1: In procedure quotient in expression (ash 0.1 -2): standard input:4:1: Wrong type argument in position 1: 0.1 ABORT: (wrong-type-arg) The scm_quotient function assumes its arguments are ints/bignums, so it can't be used directly in ash. Also: (sqrt 9/49) -> 3/7? Seems like it should parallel: guile> (expt 2 -2) 1/4 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel