Numerical Data Types

Explore Swift data types in detail and learn about the numerical types supported by Swift. Additionally, use Boolean variables to store true and false values.

Now that we have a basic understanding of the concept of data types and why they are necessary, we can take a closer look at some of the more commonly used data types supported by Swift, starting with numerical data types.

Integer data types

Swift integer data types are used to store whole numbers (in other words a number with no decimal places). Integers can be signed (capable of storing positive, negative, and zero values) or unsigned (positive and zero values only).

Swift provides support for 8, 16, 32, and 64-bit integers (represented by the ...