News for hackers. Stuff that matters.
Re:Deno Is Webby by bern4444 on Wednesday March 16, 2022 @10:44PM (#30707052)
I agree a standard library for JS would be great, but .1 + .2 != .3 is the case in several languages and is not anything to do with JS.

This also is or can be the case in C, C++, Clojure, Python, and many other languages [1].

[1] https://0.30000000000000004.com

Re:Deno Is Webby by noveltyaccount on Wednesday March 16, 2022 @10:58PM (#30707144)
Yes... It's an artifact of floating points. My issue is that JS only has floating points and not Ints and Decimal.
Re:Deno Is Webby by runarberg on Wednesday March 16, 2022 @11:45PM (#30707435)
There is a stage 1 proposal for BigDecimal.

https://github.com/tc39/proposal-decimal

Re:Deno Is Webby by hajile on Wednesday March 16, 2022 @11:19PM (#30707289)
JS has had integers since pretty much day 1 with bitwise operators. They just (from a user perspective) convert back afterward. If you were choosing just one though, floats would definitely be a better choice than integers.

It's also possible to make length 1 typed arrays of integers and operate on them if you really need. Then, as you mention there's BigInt numbers which are supported on the last few versions of every major browser except IE11.