c#double定义
The double is a fundamental data type built into the compiler and used to define numeric variables holding numbers with decimal points. C, C++, C# and many other programming languages recognize the double as a type. A double type can represent fractional as well as whole values. It can contain up to 15 digits in total, including those before and after the decimal point.
double是编译器内置的基本数据类型,用于定义包含带小数点数字的数字变量 。 C,C ++, C#和许多其他编程语言将double视为一种类型。 双精度类型可以表示小数和整数值。 它最多可包含在总共 15位,包括那些之前和小数点后。
双重用途 ( Uses for Double )
The float type, which has a smaller range, was used at one time because it was faster than the double when dealing with thousands or millions of floating-point numbers. Because calculation speed has increased dramatically with new processors, however, the advantages of floats over doubles are negligible. Many programmers consider the double type to be the default when working with numbers that require decimal points.
一次使用较小范围的浮点类型,因为在处理成千上万个浮点数时,它比双精度类型快。 但是,由于新处理器的计算速度已大大提高,因此浮点数比双精度点的优势微不足道。 许多程序员在处理需要小数点的数字时都将double类型视为默认类型。
Double vs.Float和Int ( Double vs. Float and Int )
Other data types include float and int. The double and float types are similar, but they differ in precision and range:
其他数据类型包括float和int 。 double和float类型是相似的,但是它们的精度和范围不同:
A float is a single precision, 32-bit floating-point data type that accommodates seven digits. Its range is approximately 1.5 × 10−45 to 3.4 × 1038.
浮点数是一种单精度的32位浮点数据类型,可容纳7位数字。 其范围约为1.5×10 -45至3.4×10 38。
A double is a double-precision, 64-bit floating-point data type. It accommodates 15 to 16 digits, with a range of approximately 5.0 × 10−345 to 1.7 × 10308.
double是双精度的64位浮点数据类型。 它可以容纳15到16位数字,范围约为5.0×10 -345到1.7×10 308 。
The int also deals with data, but it serves a different purpose. Numbers without fractional parts or any need for a decimal point can be used as int. Thus, the int type holds only whole numbers, but it takes up less space, the arithmetic is usually faster, and it uses caches and data transfer bandwidth more efficiently than the other types.
整数还处理数据,但它有不同的用途。 没有小数部分或不需要小数点的数字都可以用作int。 因此,int类型仅包含整数,但占用的空间较小,算术通常更快,并且与其他类型相比,它更有效地使用缓存和数据传输带宽。
c#double定义