Mono Class Library: System NamespaceSystem.Double Structure |
See Also: Double Members
|
This type is safe for multithreaded operations.
double is a 64-bit double precision floating-point type that represents values ranging from approximately 5.0E-324 to 1.7E+308 and from approximately -5.0E-324 to -1.7E+308 with a precision of 15-16 decimal digits. The double type conforms to standard IEC 60559:1989, Binary Floating-point Arithmetic for Microprocessor Systems.
A double can represent the following values:
- The finite set of non-zero values of the form s * m * 2e, where s is 1 or -1, and 0 < m < 253 and -1075 <= e <= 970.
- Positive infinity and negative infinity. Infinities are produced by operations that produce results with a magnitude greater than that which can be represented by a double, such as dividing a non-zero number by zero. For example, using double operands, 1.0 / 0.0 yields positive infinity, and -1.0 / 0.0 yields negative infinity. Operations include passing parameters and returning values.
- The Not-a-Number value (NaN). NaN values are produced by invalid floating-point operations, such as dividing zero by zero.
When performing binary operations, if one of the operands is a double, then the other operand is required to be an integral type or a floating-point type (double or float). Prior to performing the operation, if the other operand is not a double, it is converted to double, and the operation is performed using at least double range and precision. If the operation produces a numeric result, the type of the result is double .
The floating-point operators, including the assignment operators, do not throw exceptions. Instead, in exceptional situations, the result of a floating-point operation is zero, infinity, or NaN, as described below:
- If the result of a floating-point operation is too small for the destination format, the result of the operation is zero.
- If the magnitude of the result of a floating-point operation is too large for the destination format, the result of the operation is positive infinity or negative infinity, as appropriate for the sign of the result.
- If a floating-point operation is invalid, the result of the operation is NaN.
- If one or both operands of a floating-point operation are NaN, the result of the operation is NaN.
Conforming implementations of the CLI are permitted to perform floating-point operations using a precision that is higher than that required by the double type. For example, hardware architectures that support an "extended" or "long double" floating-point type with greater range and precision than the double type could implicitly perform all floating-point operations using this higher precision type. Expressions evaluated using a higher precision might cause a finite result to be produced instead of an infinity.
[Edit]
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0