Real data types are used for any inprecise number, a number with decimal places (while Integers use whole numbers only). They can be positive or negative.
Note that Real is of the Number type, but function that require this specifically require a usually non-whole number.
The LUA will interchange Real and Integer numbers when declared, if they change during the course of the use. See the example code.
function Test() -- Declare some real numbers local myreal1 = 10.5 local myreal2 = -5.2 local myreal3 = 10 / 3 -- Change a real to an integer local myreal4 = 1.5 myreal4 = myreal4 - 0.5 -- myreal4 now equals 1, an integer number. end
Data Types
Functions
SCAR Home
Wiki Home