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.
BECAREFUL.
truncatingRemainder(dividingBy:) can be tricky. See below:
Swift 4:
//case 1 let reminder = (4.1 * 100).truncatingRemainder(dividingBy: 1.0) //case 2 let reminder2 = (410).truncatingRemainder(dividingBy: 1.0) // reminder = 0.9999999999999432 // reminder2 = 0