4 ms·
Unless I have to actually work with floats, I try to only do everything with int math to keep things sane. Not to mention, that it usually makes calculations fa
by moftz 7y ago
Unless I have to actually work with floats, I try to only do everything with int math to keep things sane. Not to mention, that it usually makes calculations faster.
- Aardwolf 7y agoDecimal floating point exists (https://en.wikipedia.org/wiki/Decimal64_floating-point_format https://en.wikipedia.org/wiki/Decimal64_floating-point_forma...), is that considered useable for financial data, or does it turn out in practice to also suffer from the same issues? Since, e.g., dividing through 3 will not be exact here either of course.
- HideousKojima 7y agoIt doesn't have the same issues (at least from my experience in C#) but it runs quite a bit slower than normal floats and doubles: http://csharphelper.com/blog/2017/05/compare-the-performance-of-the-float-double-and-decimal-data-types-in-c/ http://csharphelper.com/blog/2017/05/compare-the-performance...