REAL/LREAL Constants

You can specify floating-point numbers as REAL and LREAL constants in dot notation or in exponential notation with mantissa and exponent. The dot serves as a decimal symbol according to the International System of Units (English).

Syntax Exponential representation:

<significand> e | E <exponent>
exponent :  -44..38    // REAL
exponent : -324..308   // LREAL

Examples:

7.4

Decimal number; 7,4 with comma returns compiler error.

1/3.0

Decimal fraction for 0.333333343

Note: When dividing integer types, the result remains an integer type. Truncation takes place. For example, 1/3 returns 0 as the result.

1.64e+009

Exponential representation

REAL literal

-3.402823e+38

Smallest number

-1E-44

Largest negative number

1.0E-44

Smallest positive number

3.402823e+38

Largest number

LREAL literal

-1.7976931348623157E+308

Smallest number

-4.94065645841247E-324

Largest negative number

4.94065645841247E-324

Smallest positive number

1.7976931348623157E+308

Largest number

REAL/LREAL Constants 1:

Allocation of a particularly large literal

To assign an integer literal that is greater than the upper limit of ULINT, either set a comma or specify an explicit typecast. Without such a specification as a floating-point number, information can be lost.
Example:
fMyReal : REAL := 3400000000000000000000.0;
fMyReal : REAL := REAL#3400000000000000000000;

See also: