I need to check if a double-defined variable is convertible to Int without losing its value. This doesn\'t work because they are of different types:
if self.
Using mod (%) won't work anymore.
You can now use:
let dbl = 2.0 let isInteger = dbl.truncatingRemainder(dividingBy: 1.0) == 0.0