Integer- floating point conversion in Swift

Integer values can be converted into floating point numbers and vice versa .

Example:

let intergerValue = 56

let floatingPointValue = Double(integerValue)

When floating point numbers are converted into integer values, the original value is always truncated.

 

 

Leave a Reply