From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Tutorial question re conventions or usage ?? Date: Tue, 01 May 2007 22:31:56 +0300 Message-ID: References: <1178041458.3157.37.camel@CASE> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1178047946 17456 80.91.229.12 (1 May 2007 19:32:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 1 May 2007 19:32:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 01 21:32:21 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hiy5A-0001L9-V8 for geh-help-gnu-emacs@m.gmane.org; Tue, 01 May 2007 21:32:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiyBU-0005BL-Ra for geh-help-gnu-emacs@m.gmane.org; Tue, 01 May 2007 15:38:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HiyBH-0005B3-Ne for help-gnu-emacs@gnu.org; Tue, 01 May 2007 15:38:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HiyBG-0005Ap-4Z for help-gnu-emacs@gnu.org; Tue, 01 May 2007 15:38:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiyBG-0005Am-1c for help-gnu-emacs@gnu.org; Tue, 01 May 2007 15:38:34 -0400 Original-Received: from heller.inter.net.il ([213.8.233.23]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hiy4u-0003TA-T2 for help-gnu-emacs@gnu.org; Tue, 01 May 2007 15:32:01 -0400 Original-Received: from HOME-C4E4A596F7 ([81.5.33.11]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id CMI00967 (AUTH halo1); Tue, 1 May 2007 22:31:51 +0300 (IDT) In-reply-to: <1178041458.3157.37.camel@CASE> (message from William Case on Tue, 01 May 2007 13:44:18 -0400) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:43447 Archived-At: > From: William Case > Date: Tue, 01 May 2007 13:44:18 -0400 > > (if (> (buffer-size) 10000) > ;; Avoid overflow for large buffer sizes! > (* (prefix-numeric-value arg) > (/ (buffer-size) 10)) > (/ (+ 10 (* (buffer-size) > (prefix-numeric-value arg))) > ... > > In this code the writer has reduced the numbers by a factor of 10 in > order, it seems, to get the user to supply a one digit prefix that > none-the-less ends up being a percentage. I think it's more likely that the author wanted to avoid floating-point arithmetics, and also avoid overflow (as the comment says). Interpreting the argument as percentage would require multiplication by 100, which would exacerbate the integer overflow problem. Just a guess.