Real Data Type
Holds signed floating-point values guaranteed to be at least 64 bits (8 bytes) and provides the best performance. On Intel-based systems this is an 80-bit (10-byte) value in the range −1.18973149535723176502E+4932 to −3.64519953188247460253E−4951 for negative values and 3.64519953188247460253E−4951 to 1.18973149535723176502E+4932 for positive values.
- Be aware that floating-point data types are incapable of representing many values exactly. Operations such as comparisons can produce unexpected results. See Troubleshooting Data Types for more information.
- ViviFire guarentees that calculations performed using the Real data type are the most optimal for a type at least as large as Real64. Systems for which the most optimal floating-point type is smaller than Real64 are forced to use Real64 to maintain compatibility.
- Default value
- When you declare a variable of type Real and leave it uninitialized,, its value defaults to zero (0.0).
- The Real data type widens to Real128 without any risk of overflow.
- Trailing zeros
- The floating-point data types have no internal means of representing trailing 0 characters following the decimal point. This means that numbers such as 1.4200 and 1.42 represent the same value. If you must display trailing zeros, the number will need to be formatted.
- Type characters
- Affixing the ! character to the end of a variable name declares it as having a type of Real.
[ integer_part ] . fractional_part [ E [ + | − ] exponent_part ] [ ! ]
integer_part E [ + | − ] exponent_part [ ! ]
- One or more decimal digits. You can use an underscore (_) to divide it into groups of digits.
- One or more decimal digits.
- One or more decimal digits. Typically the maximum number of digits is three or four.
Shared methods and properties
Real.Bits As UInt
- Returns the number of available bits. Typical values are 64 or 80.
Real.Epsilon As Real
- Returns the smallest difference between two values.
Real.IsNaN(x As Real) As Boolean
- Returns true if the value of x is not a number. Division by zero can cause this result.
Real.Max As Real
- Returns the maximum positive value.
Real.Min As Real
- Returns the minimum positive value.
Dim foo As Real Dim bar!