Integer data types are used for numbers which have no decimal places – whole numbers only (positive or negative).
Integer is really of the Number data type, and in the LUA language, if a local is first an integer, then gets changed somehow, to a Real, it will have its data type changed (unlike other languages like C++).
Usually, this is used for counting, or a variable whole amout of something.
function Test() -- Declare some integers local myinteger1 = 1 local myinteger2 = -5 local myinteger3 = -5 -- Change an integer to a real local myinteger4 = 1 myinteger4 = myinteger4 + 0.5 -- myinteger4 is now equal to 1.5, a real number. end
Data Types
Functions
SCAR Home
Wiki Home