Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Decimal floating point exists (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.


It 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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: