Welcome to the Treehouse Community
Looking to learn something new?
What is the difference between a Double & a Float.
Citing the official Apple Swift Language Guide:
„Swift provides two signed floating-point number types:
- Double represents a 64-bit floating-point number.
- Float represents a 32-bit floating-point number.“
Double has a precision of at least 15 decimal digits, whereas the precision of Float can be as little as 6 decimal digits. The appropriate floating-point type to use depends on the nature and range of values you need to work with in your code. In situations where either type would be appropriate, Double is preferred.“