unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: Emanuel Berg via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: (- 2.8 1.6) ; 1.1999999999999997
Date: Mon, 10 Feb 2020 22:33:52 +0100	[thread overview]
Message-ID: <877e0urutb.fsf@fastmail.fm> (raw)
In-Reply-To: <8736biywcn.fsf@ebih.ebihd>


On Mon, Feb 10 2020, Emanuel Berg via Users list for the GNU Emacs 
text editor wrote:
> What's this?
>
>     (- 2.8 1.6) ; 1.1999999999999997
>
> With the TI-84 Plus,
>
>     2.8-1.6=1.2
>
> Normally I'm all pro-Lisp but here...
>
> Actually zsh also reports
>
>     echo $(( 2.8 - 1.6 )) # 1.1999999999999997

joost@Swift:~$ clojure
Clojure 1.9.0
user=> (- 2.8 1.6)
1.1999999999999997
user=> (+ 0.1 0.2)
0.30000000000000004
user=> <C-d>
joost@Swift:~$ python
Python 2.7.17 (default, Nov  7 2019, 10:07:09)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more 
information.
>>> 2.8 - 1.6
1.1999999999999997
>>> 0.1 + 0.2
0.30000000000000004
>>> <C-d>
joost@Swift:~$ 

> so perhaps some CPU (ALU) thing?

It's a binary thing, and it's well-known:

https://floating-point-gui.de/

-- 
Joost Kremers
Life has its moments



  parent reply	other threads:[~2020-02-10 21:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 21:18 (- 2.8 1.6) ; 1.1999999999999997 Emanuel Berg via Users list for the GNU Emacs text editor
2020-02-10 21:31 ` tomas
2020-02-10 21:33 ` Joost Kremers [this message]
2020-02-10 23:10   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-02-11  1:31 ` Stefan Monnier
2020-02-11  1:50   ` Alexandre François Garreau
2020-02-11  1:55   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-04-07 14:00   ` Bruno Félix Rezende Ribeiro

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=877e0urutb.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).