Hello, so basically I am wondering how i can check for number types.
In Regular Lua, there is a
math function known as
math.type() which would allow you to check what type of number a number is, Like if its a Float, or if its an Integer.
Float is a number with Decimals
Integer is a whole number
However in Luau, It is known as a
Double rather than a
Float, which I don’t understand why, and yet people get confused for angry when I call it a
Float instead of a
math.type(12) --> integer math.type(21.1) --> float (or "double")
There is Obviously a whole lot more to my statement of:
But this is just supposed to be a Basic Rundown, and I want to stay on Topic, so I wont get into that
But Inside Luau,
math.type() doesn’t exist like with many other
math functions, and It doesn’t appear to be Documented under Compatibility or Type Checking, unless I’m not looking thoroughly enough (which is likely the case), However, there may be reasons for
math.type() not being in Luau that I’m probably not aware of.
How would I check for number types within Luau as it doesn’t appear to have this simple function like Lua?