The data types REAL and LREAL are floating-point types according to IEEE 754. Floating-point types are necessary when using decimal numbers and floating-point numbers in decimal notation or exponential notation.
Table 20. Target System
|
Data Type |
Smallest value number |
Largest value number |
Memory |
|---|---|---|---|
|
|
1.0E-44 |
3.402823E+38 |
32-bit |
|
|
4.94065645841247E-324 |
1.7976931348623157E+308 |
64 bits |
Example 206. Example
PROGRAM PLC_PRG
VAR
rMax: REAL := 3.402823E+38; // Largest number
rPosMin : REAL := 1.0E-44; // Smallest positve number
rNegMax: REAL := -1.0E-44; // Largest negative number
rMin: REAL := -3.402823E+38; // Smallest number
lrMax: LREAL := 1.7976931348623157E+308; // Largest number
lrPosMin : LREAL := 4.94065645841247E-324; // Smallest positve number
lNegMax: LREAL := -4.94065645841247E-324; // Largest negative number
lrMin: LREAL := -1.7976931348623157E+308; // Smallest number
END_VAR
|
Important |
|---|---|
|
Support for the |
|
Important |
|---|---|
|
If the value of the If the |