April 2026
Intermediate
683 pages
25h 29m
English
We already took a sneak peek at variables storing numbers in Section 2.1. Now, we’ll broaden your understanding and cover some numeric types that Swift has to offer, contrasting their differences.
Nearly all applications need to deal with numbers in some form or shape; therefore, it is natural for any programming language to have strong support for numbers. Swift is no exception in that regard. But number is a vague term. In a strongly typed language like Swift, the compiler needs to know some things about your numeric variable, such as the following:
Will you store whole numbers only, or do you need decimals?
If you need decimals, how precise do they need to be?
Swift needs to know because simpler ...
Read now
Unlock full access