lua-users home
lua-l archive

5.3.0-work2 determining number type

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Is there a way to determine if a number is an integer or a float? For example,
 x = 4 // 2 -- this will be an integer
		y = 2.5 -- this will be a float
		type(x) -- number
		type(y) -- number
		isInteger(x) -- true
		isInteger(y) -- false
		isFloat(x) -- false
		isFloat(y) -- true
Is there a function that acts like isInteger or isFloat? Or, is there another
way to tell if a number is of one species or the other?
P.S. - 5.3.0-work2 built fine on Fedora 19 x86_64 with gcc 4.8.2.
-- 
Christopher Berardi
May grace and peace be yours in abundance.

AltStyle によって変換されたページ (->オリジナル) /