News for hackers. Stuff that matters.
Re:Vercel, formerly Zeit, raises $21M Series A by WJW on Tuesday April 21, 2020 @08:08AM (#22934169)
0.1 + 0.2 == 0.3 returns false in all the interpreters I have installed locally (Ruby, Python, NodeJS and Haskell), and you can't with a straight face pretend that Haskells type system is not strict enough.

Because I was curious, I tested it out with C# on repl.it and behold, 0.1 + 0.2 == 0.3 returns false in C# as well: https://repl.it/repls/AdoredValidVirtualmachines. Not very surprising of course, since that "error" is a result of the IEEE floating point spec and not of any language.

Re:Vercel, formerly Zeit, raises $21M Series A by Davertron on Tuesday April 21, 2020 @08:19AM (#22934237)
Thank you, I'm so sick of this being used as an example of why JavaScript is bad...
Re:Vercel, formerly Zeit, raises $21M Series A by covidcovidcovid on Tuesday April 21, 2020 @09:52AM (#22934973)
If you write in C# decimal a = 0.1m; decimal b = 0.2m; var result = a + b; then you will get exactly 0.3, because decimal is a special high-precision numeric type that doesn't have such issues.