Skip to content

Instantly share code, notes, and snippets.

@foxicode
Last active August 10, 2020 12:12
Show Gist options
  • Select an option

  • Save foxicode/11d42d702d1d3688292604447d0a56df to your computer and use it in GitHub Desktop.

Select an option

Save foxicode/11d42d702d1d3688292604447d0a56df to your computer and use it in GitHub Desktop.
Conversions between Int and Double
import Foundation
extension Int {
func toDouble() -> Double {
Double(self)
}
}
extension Double {
func toInt() -> Int {
Int(self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment