📜  swift代码示例中的float vs double

📅  最后修改于: 2022-03-11 15:01:01.650000             🧑  作者: Mango

代码示例2
/* Float can only hold seven digits of decimal numbers
while Double can hold twice the number. */
// i.e:
let valueOfPi: Float = 3.142857143 
print(valueOfPi) // 3.142857

let valueOfRandomDecimal: Double = 7.1428571434322432345331
print(valueOfRandomNumber) // 7.142857143432243