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.
Swift 3
if dbl.truncatingRemainder(dividingBy: 1) == 0 { //it's an integer }