Answers for "double vs float in swift"

0

swift double v float

Double is 64-bit // stores more precise decimal number
Float is 32-bit
Posted by: Guest on September-28-2020
0

float vs double in swift

/* 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
Posted by: Guest on January-02-2022

Code answers related to "Swift"

Browse Popular Code Answers by Language