[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: calculation error with built-in command CTRL + J?!
From: |
Thierry Volpiatto |
Subject: |
Re: calculation error with built-in command CTRL + J?! |
Date: |
Mon, 14 Apr 2008 08:24:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
"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