algorithm to check if a number is an integer code example
Example: algorithm to know if a number is an integer
// The most basic thing you could do is check if x=floor(x).
if (num != Math.floor(num)) { ... }
// The most basic thing you could do is check if x=floor(x).
if (num != Math.floor(num)) { ... }