From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: calculation error with built-in command CTRL + J?! Date: Mon, 14 Apr 2008 08:24:28 +0200 Message-ID: <87skxpdkdf.fsf@thievol.homelinux.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1208154294 7724 80.91.229.12 (14 Apr 2008 06:24:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Apr 2008 06:24:54 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Borde\, Andreas" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 14 08:25:32 2008 connect(): Connection refused 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 1JlI88-0007LB-8m for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Apr 2008 08:25:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JlI7T-0005du-SY for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Apr 2008 02:24:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JlI78-0005d2-OB for help-gnu-emacs@gnu.org; Mon, 14 Apr 2008 02:24:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JlI77-0005cQ-VV for help-gnu-emacs@gnu.org; Mon, 14 Apr 2008 02:24:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JlI77-0005cK-NO for help-gnu-emacs@gnu.org; Mon, 14 Apr 2008 02:24:25 -0400 Original-Received: from fg-out-1718.google.com ([72.14.220.156]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JlI77-0006Np-Fs for help-gnu-emacs@gnu.org; Mon, 14 Apr 2008 02:24:25 -0400 Original-Received: by fg-out-1718.google.com with SMTP id d23so2856455fga.30 for ; Sun, 13 Apr 2008 23:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references:date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=0PgNt0DOvrCJGLXHUVxxu7ukeI+SfOW5cwpRe1yzfUA=; b=ULhYgzLyPhQ76weW4/+Ro1JSzDGv1qE1kI/4SZvpRsBeSlySmBtzFtAB/wTDcyqibaueqxIUUPQHq81YohnJ9L6htFF6VBIHSxLCGmHF1sYoaRfBOG/bKac8Dw6EEglooYH2abwLQdQqi7eg41DReTTpN5rjJUJ4uYTe41xDHvg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id:user-agent:mime-version:content-type; b=NuJiQ+FdmhVDc8XPr/d6wgNqfcploZyEB/dBGJ/1RJmmKsNko5Y8gSjVZqc0kUxz4hn9n+1/5eKW2xK0gyFKjMeGISpsq5pg5PX+cMEQNdYwjZAniG1Jio7t6TQ2UITtYTmAcaVzPX7A0E+T5VZx01Wsy/WbFt5wy9Xv68D6zvI= Original-Received: by 10.82.188.14 with SMTP id l14mr1814079buf.44.1208154263943; Sun, 13 Apr 2008 23:24:23 -0700 (PDT) Original-Received: from thievol.homelinux.org ( [79.85.211.126]) by mx.google.com with ESMTPS id b9sm8095982mug.12.2008.04.13.23.24.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Apr 2008 23:24:22 -0700 (PDT) In-Reply-To: (Andreas Borde's message of "Mon, 14 Apr 2008 12:59:10 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 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:53275 Archived-At: "Borde, Andreas" writes: > Hello, > > I calculated > (* 12 2.6) with the built in command CTRL + J and got > 31.200000000000003 Hello, you have to use round like that: ,---- | ELISP> (/ (round (* 100 | (* 2.6 12))) | 100.0) | 31.2 `---- > It is the same for > (* 2.6 12) > > I am wondering about the tailing numbers after 31.2! > > If I calculate (* 2.5 12) then the result is the expected 30.0. > > Can someone tell me the reason? Is there something wrong with > my calcuation? > > I am using the official release: > > This is GNU Emacs 22.1.1 (i386-mingw-nt5.0.2195) > of 2007-06-02 on RELEASE > > under Win2k. > > Thank you and kind regards > > Borde, Andreas > > -- A + Thierry Pub key: http://pgp.mit.edu