RDNWiki: DOWScar/Functions/Real ...

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

Real Data Type


Contents


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.

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

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]