Decimal type of value type:
C# specifically defines a decimal type (decimal) for us (previously, C/C++ did not have subtypes), which is mainly used in finance or currency. calculate. The decimal type is a high-precision, 128-bit data type that can retain 28 or 29 significant digits (double only has 15 or 16 digits, which has been tested in the previous article), although its value range is smaller than double There are more, but it is much more accurate than double.
When defining a decimal variable and assigning it a value, use the m subscript to indicate that it is a decimal type (because C# default decimal is double type);
For example: decimal value = 1.0m;
The above is the content of C# Learning Diary 07---the decimal type of data type. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!