[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (- 2.8 1.6) ; 1.1999999999999997
From: |
Joost Kremers |
Subject: |
Re: (- 2.8 1.6) ; 1.1999999999999997 |
Date: |
Mon, 10 Feb 2020 22:33:52 +0100 |
User-agent: |
mu4e 1.3.7; emacs 26.3 |
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