3 ms·
Is not a JS only thing, investigate how floating point values work.
by Scarbutt 12y ago
Is not a JS only thing, investigate how floating point values work.
- MichaelGG 12y agoWell other languages often offer decimal, or higher precision floats, right?
- Scarbutt 12y agoright, but I think he first needs some insight on how IEEE 754 floating point arithmetic works.
- jahewson 12y agoNot 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.
- pests 12y agoYes, .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 https://msdn.microsoft.com/en-us/library/364x0z75.aspx
- pests 12y agoYes, .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 https://msdn.microsoft.com/en-us/library/364x0z75.aspx