Skip to content

Comment on A re-introduction to JavaScriptparent

Comments

Is not a JS only thing, investigate how floating point values work.

Well other languages often offer decimal, or higher precision floats, right?

Not really. Most languages don't have a built-in decimal type, it's usually just a library feature. Higher precision floats won't help you either, as adding more decimal places won't make 0.2 == 0.3, it will just make the difference between them slightly smaller.

Yes, .NET is a good example with a decimal type with:

Approximate Range -> (-7.9 x 1028 to 7.9 x 1028) / (100 to 28)

Precision -> 28-29 significant digits

https://msdn.microsoft.com/en-us/library/364x0z75.aspx

right, but I think he first needs some insight on how IEEE 754 floating point arithmetic works.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.