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: ash docstring Date: Sun, 19 Oct 2003 10:28:18 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87vfqm2hr1.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1066523373 28848 80.91.224.253 (19 Oct 2003 00:29:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 19 Oct 2003 00:29:33 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Oct 19 02:29:31 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 1AB1Rr-0003YQ-00 for ; Sun, 19 Oct 2003 02:29:31 +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 1AB1RU-0000Fx-8i for guile-devel@m.gmane.org; Sat, 18 Oct 2003 20:29:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AB1RL-0000Ex-Pf for guile-devel@gnu.org; Sat, 18 Oct 2003 20:28:59 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AB1Qo-0008JW-9e for guile-devel@gnu.org; Sat, 18 Oct 2003 20:28:58 -0400 Original-Received: from [61.8.0.36] (helo=snoopy.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AB1Qn-0008Ij-Fv for guile-devel@gnu.org; Sat, 18 Oct 2003 20:28:25 -0400 Original-Received: from mongrel.pacific.net.au (mongrel.pacific.net.au [61.8.0.107]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9J0SNUC020814 for ; Sun, 19 Oct 2003 10:28:23 +1000 Original-Received: from localhost (ppp107.dyn228.pacific.net.au [203.143.228.107]) by mongrel.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id h9J0OGst026274 for ; Sun, 19 Oct 2003 10:24:16 +1000 Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 1AB1Qg-0005TC-00; Sun, 19 Oct 2003 10:28:18 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) 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:2907 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2907 --=-=-= * numbers.c (scm_ash): Revise docstring as per recent update to manual. --=-=-= Content-Disposition: attachment; filename=numbers.c.ash-doc.diff --- numbers.c.~1.204.~ 1970-01-01 10:00:01.000000000 +1000 +++ numbers.c 2003-10-19 10:27:26.000000000 +1000 @@ -1367,20 +1367,24 @@ SCM_DEFINE (scm_ash, "ash", 2, 0, 0, (SCM n, SCM cnt), - "The function ash performs an arithmetic shift left by @var{cnt}\n" - "bits (or shift right, if @var{cnt} is negative). 'Arithmetic'\n" - "means, that the function does not guarantee to keep the bit\n" - "structure of @var{n}, but rather guarantees that the result\n" - "will always be rounded towards minus infinity. Therefore, the\n" - "results of ash and a corresponding bitwise shift will differ if\n" - "@var{n} is negative.\n" + "Return @var{n} shifted left by @var{cnt} bits, or shifted right\n" + "if @var{cnt} is negative. This is an ``arithmetic'' shift.\n" "\n" - "Formally, the function returns an integer equivalent to\n" - "@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.\n" + "This is effectively a multiplication by 2^@var{cnt}}, and when\n" + "@var{cnt} is negative it's a division, rounded towards negative\n" + "infinity. (Note that this is not the same rounding as\n" + "@code{quotient} does.)\n" + "\n" + "With @var{n} viewed as an infinite precision twos complement,\n" + "@code{ash} means a left shift introducing zero bits, or a right\n" + "shift dropping bits.\n" "\n" "@lisp\n" "(number->string (ash #b1 3) 2) @result{} \"1000\"\n" "(number->string (ash #b1010 -1) 2) @result{} \"101\"\n" + "\n" + ";; -23 is bits ...11101001, -6 is bits ...111010\n" + "(ash -23 -2) @result{} -6\n" "@end lisp") #define FUNC_NAME s_scm_ash { --=-=-= 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 --=-=-=--