I'm making a program regarding numbers but I don't know how to check if the variable is a whole number or a number with a decimal.
If someone could please tell me I would very much appreciate it.
you could floor() the number and compare it with itself. If it's the same it's an int, if not a float
Develop games in your browser. Powerful, performant & highly capable.
or maybe better:
if number % 1 = 0 it's an int
Thanks a lot!