Real32 Data Type
Holds signed 32-bit (4-byte) IEEE floating-point values in the range −3.4028235E+38 to −1.401298E−45 for negative values and 1.401298E−45 to 3.4028235E+38 for positive values.
Instructions
- Precision
- Floating-point data types cannot store all values accurately. Some operations can cause results that you think are incorrect. A typical example is when you compare values. See Data Type Troubleshooting for more information.
- Space efficiency
- You can use
Real32in conditions where the increased precision ofReal64is not necessary. Some conditions can let the ViviFire runtime decrease the memory that your program uses. - Default value
- When you declare a variable of type
Real32and do not initialize it, its default value is zero (0.0). - Automatic conversions
Real32widens toReal64orReal128without risk of overflow.- Zeros at the end
- The floating-point data types usually cannot show 0 characters at the end, after the decimal point. Thus numbers, for example, 1.4200 and 1.42 are the same value. If you must show zeros at the end, you must use a formatter procedure.
- Type characters
- You can put the suffix
r32(orR32) on the end of a number literal. But there are no type characters for names.
Shared methods and properties
Real32.Default As Real32- Returns the default value,
0.0. Real32.Epsilon As Real32- Returns the smallest difference between two values.
Real32.IsInf(num As Real32) As Boolean- Returns true if
numis infinity (positive or negative). Mathematical overflow is one cause of this result. Real32.IsNaN(num As Real32) As Boolean- Returns true if
numis not a number (NaN). “Zero divided by zero” and “square root of a negative” are two causes of this result. Real32.IsNegInf(num As Real32) As Boolean- Returns true if
numis negative infinity. Real32.IsPosInf(num As Real32) As Boolean- Returns true if
numis positive infinity. Real32.Max As Real32- Returns the maximum positive value.
Real32.Min As Real32- Returns the minimum negative value.
Real32.Parse(str As String, Optional #format As Format) As Real32- Tries to parse a string that shows as a floating-point number.
- If
#formatis not given or is#Null, it uses the format of the local culture. Or you can make it clear withFormat.UserLocale. - If
#formatisFormat.RealLiteral, it uses the format of a literal of typeReal32. Real32.Size As Int32- Returns the number of available bytes. This is always 4.
Examples
Dim foo As Real32