How to find that a number is float
or integer
?
1.25 --> float
1 --> integer
0 --> integer
0.25 --> float
<
It really depends on what you want to achieve. If you want to "emulate" strongly typed languages then I suggest you not trying. As others mentioned all numbers have the same representation (the same type).
Using something like Claudiu provided:
isInteger( 1.0 )
-> true
which looks fine for common sense, but in something like C you would get false