Double
From Real Software Documentation
Data Type
A Double is an intrinsic data type in Real Studio. A Double is a number that can contain a decimal value, i.e., a real number. In other languages, Real Studio’s Double may be referred to as a double precision floating point number. Because Doubles are numbers, you can perform mathematical calculations on them. Doubles use 8 bytes of memory. The default value of a Double is 0.0.
The VarType function returns a value of 5 when passed a Double.
Notes
Numerical limits
- The maximum value of a double is: ±1.79769313486231570814527423731704357e+308
- The minimum value towards zero is: ±4.94065645841246544176568792868221372e-324
NaN and Infinity
As singles, doubles can hold some special values described below:
- NaN (i.e. "Not a Number"): occurs if you attempted to perform an illegal mathematical operation, like getting the square root of a negative number. Any further calculation made with a NaN will lead to a NaN value. Str or Format methods return a string beginning with "NaN", e.g. "NaN(021)".
- Infinity: some calculations lead to an infinite result (positive or negative), e.g. Log( 0 ), or you may exceed the maximum value which can be hold. In such a case, a double will be set to a special value, whose Str will return "INF" (for INFinity) or "-INF" (negative INFinity). Any further calculation will lead to a NaN or infinity value.
Examples
The Double data type allows you to store and manage floating point numbers.
See Also
- Double precision floating point format on Wikipedia to learn more on the internal structure of a Double.
- Dim, Static, Declare statements; -, +, *, /, <, <=, =, >=, >, <> VarType functions; Boolean, Byte, CFStringRef, Color, CString, Currency, Delegate, Double, Int16, Int32, Int64, Int8, Integer, OSType, PString, Ptr, Short, Single, String,UInt16, UInt32, UInt64,UInt8,UShort, Variant, WindowPtr, WString data types. IsNumeric, Mod, Str, Val, Vartype, functions.
