How to check if type of a variable is float?
Float isn’t basic type of values in Lua, so function type() return only number.
How to check if type of a variable is float? Float isn’t basic type
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
All numbers in Lua are floating point1. You can tell is a number represents a number with non-zero fractional part by using
math.modf.1 Unless lua’s code itself is compiled with a flag that instructs it to use integers instead of floating-point numbers, in which case you cannot use floating point numbers in your programs at all.