Home > Backend Development > C#.Net Tutorial > C# Learning Diary 07---The decimal type of data type

C# Learning Diary 07---The decimal type of data type

黄舟
Release: 2017-01-20 13:31:49
Original
2012 people have browsed it

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 (m.sbmmt.com)!


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template