A float is a number with a fractional part, which can represent a larger range than an integer type, and the stored value can be much larger or smaller than the value stored in an int type. Swift provides two signed floating-point number types:
A Double represents a 64-bit floating-point number. Used to represent a value that must be very large or high precision when high accuracy.
Float represents a 32-bit floating-point number. When used to represent a value that does not require 64-bit precision, the precision is smaller than double.
Note: Double has a minimum of 15 decimal digits, whereas float has only 6 decimal digits, and choosing that type in your code depends on the nature and size of the value you need. For example, the bank system of money flow related data needs high precision large range of values to represent, then you need to use double.
Swift's floating point number