RDNWiki: DOWScar/Functions/Integer ...

RDN Wiki Home | Page Index | Recent Changes | Recently Commented | Users | Registration | Login:  Password:  

Integer Data Type


Contents


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.

Example Code

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

Links


Data Types
Functions
SCAR Home
Wiki Home

End of Page

There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]