What is a method to check if the output of a calculation is a whole number? I've tried doing this:
if ((i / 3) is Int ) {
print("Whole Number")
}
But it seems to be checking the type of the variable, not what the output is.
Edit: Apparently if the variable is an integer, it automatically rounds the output of the operation, so I had to do something like this:
if((i.toFloat()/3) == (i / 3).toFloat()){
println("Whole Number")