i love computers, they are so good at computing:

> 1.2 + 1.2
=> 2.4
> 1.2 + 2.2
=> 3.4000000000000004

@colt Ruby in this case, but any language that implements floating point math will have the same issue

@meena Correct. Python with Decimal 1.2 + 2.2 = 3.400000000000000133226762955 🙈​

@colt

~ $ lua5.3
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
> 1.2 + 2.2
3.4

And

~ $ node
Welcome to Node.js v16.13.0.
Type ".help" for more information.
> 1.2 + 2.2
3.4000000000000004

what's funny to me is that Lua makes almost all the same design decisions as JavaScript, but Lua does it right.

@meena
Yeah, 👏​ Lua

bc -l <<< "1.2+2.2"
3.4

GNU bc 🧐​

Inscrivez-vous pour prendre part à la conversation
nanao

Comme le soleil, les machines ne se couchent jamais.