More Related Content
More from Tomohiro Kumagai (20)
みんなで Swift 復習会 GO! in 沖縄・発表資料
- 5. let pi = 3.14
let attempts = 1
let price: Double = 100
Double 型
Int 型
Double 型
- 6. let price = 100
let tax = 1.08
// Int 型と Double 型は、型が違うので計算できない
let result = price * tax
// 希望の型に揃えて計算する
let result = Int(Double(price) * tax)