From Newsgroup: comp.arch
On Sat, 4 Apr 2026 06:49:57 -0000 (UTC), Thomas Koenig wrote:
See https://xkcd.com/3228/ . The mouseover text is even funnier.
Roll on, decimal arithmetic.
LibreOffice Calc:
= 0.1 + 0.1 + 0.1 - 0.3
evaluates to
0
Python, binary arithmetic:
0.1 + 0.1 + 0.1 - 0.3
evaluates to
5.551115123125783e-17
Python, decimal arithmetic:
>>> import decimal; D = decimal.Decimal
>>> D("0.1") + D("0.1") + D("0.1") - D("0.3")
evaluates to
Decimal('0.0')
--- Synchronet 3.21f-Linux NewsLink 1.2