C# floating Point types

The tradeoff between decimal and double is precision versus range. The decimal is the best choice when precision is required, but choose a double for the greatest range. The decimal
type is well suited for financial calculations, as shown in the following example:
decimal annualSales = 99873582948769876589348317.95m;

A final word on literal suffixes: There are common suffixes for each literal type. Suffixes ensure that the literal is the intended type. This is good for documentation. However, the
primary benefit is ensuring that your expressions are evaluated correctly; that is, the compiler will interpret float and decimal literals without suffixes as a double when evaluating
an expression. To avoid the associated errors, use an appropriate literal suffix (f/F, d/D, m/M).

原文地址:https://www.cnblogs.com/taoxu0903/p/1670564.html