A real constant is an approximation of a real number. It can be positive, negative, or zero. It has a decimal point or an exponent. If no sign is present, the constant is assumed to be nonnegative.
Real constants, REAL*4, use 4 bytes of storage.
A basic real constant consists of an optional plus or minus sign, followed by an integer part, followed by a decimal point, followed by a fractional part.
The integer part and the fractional part are each strings of digits, and you can omit either of these parts, but not both.
Example: Basic real constants:
+82. -32. 90. 98.5
A real exponent consists of the letter E, followed by an optional plus or minus sign, followed by an integer.
E+12 E-3 E6
A real constant has one of these forms:
Basic real constant
Basic real constant followed by a real exponent
Integer constant followed by a real exponent
A real exponent denotes a power of ten. The value of a real constant is the product of that power of ten and the constant that precedes the E.
-32. -32.18 1.6E-9 7E3 1.6E12 $1.0E2.0 Invalid- $ not allowed, error message 82 Not REAL-need decimal point or exponent 29,002.0 Invalid -comma not allowed, error message 1.6E39 Invalid-too large, machine infinity is used 1.6E-39 Invalid -too small, some precision is lost
The restrictions are:
Other than the optional plus or minus sign, a decimal point, the digits 0 through 9, and the letter E, no other characters are allowed.
The magnitude of a normalized single-precision floating-point value must be in the approximate range (1.175494E-38, 3.402823E+38).