all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: "Borde\, Andreas" <andreas.borde@jp.bosch.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: calculation error with built-in command CTRL + J?!
Date: Mon, 14 Apr 2008 08:24:28 +0200	[thread overview]
Message-ID: <87skxpdkdf.fsf@thievol.homelinux.org> (raw)
In-Reply-To: <ftukqh$tbi$1@news4.fe.internet.bosch.com> (Andreas Borde's message of "Mon, 14 Apr 2008 12:59:10 +0900")

"Borde, Andreas" <andreas.borde@jp.bosch.com> 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




  parent reply	other threads:[~2008-04-14  6:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14  3:59 calculation error with built-in command CTRL + J?! Borde, Andreas
2008-04-14  6:11 ` David Hansen
2008-04-14  6:24 ` Thierry Volpiatto [this message]
2008-04-14  6:40 ` Sven Joachim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87skxpdkdf.fsf@thievol.homelinux.org \
    --to=thierry.volpiatto@gmail.com \
    --cc=andreas.borde@jp.bosch.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.