On Monday, 11 March 2019 at 15:23:34 UTC, BoQsc wrote:
There is Money datatype that can be provided by using a third party package: https://code.dlang.org/packages/money

But that's only for money, what about math?
Why such fundamental as BigDecimal is still not included into the D language itself?
There is BigInt.

If it is unavoidable to use Floating point, how can I quickly and simply understand the rules of using float to make the least error, or should I just find a third party package for that as well?


There is an article on that, but it is not that straight forward:
https://dlang.org/articles/d-floating-point.html

Basically any thing that I find on Google, that include explaining floating point are badly written and hard to understand for the outsider lacking ability to understand advanced concepts.

I recommend that you learn floating point math as this will help you not only in programming in D, but in any other language.

In any case, if you need super-high precision, you might want to give decimal [1] a try.

[1] https://code.dlang.org/packages/decimal

Reply via email to