Jump to ratings and reviews
Rate this book

Flight School - Guide to Swift Numbers

Rate this book
Swift 4 overhauled its number system to adopt a protocol-oriented design. Not only does that simplify the way you work with integer and floating-point numbers, but it allows anyone to define their own numeric types that look and feel like they’re built-in.

This guide offers a comprehensive look at what's new, and how to take advantage of these changes in your own apps.

The first chapter takes a deep dive into how numbers work on computers in general and in Swift specifically. After reading it, you’ll be able to represent integers in binary, decimal, and hexadecimal, explain how signed integers store positive and negative numbers using two’s complement, convert bit patterns into decimal floating-point numbers, and much more.

From there, the book looks at different ways you can use numbers, such as:

Working with money, using the Decimal type and creating a Currency type
Performing dimensional analysis and physical calculations using the Foundation units & measurements API and Playground live views
Formatting numbers in a locale-appropriate way for a global audience


Each chapter starts with a delightful illustration from Lauren Mendez (@littleloboart). There are also plenty of sample code projects provided as Playground files.

152 pages, ebook

Published June 1, 2018

7 people want to read

About the author

Mattt Zmuda

3 books3 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
5 (55%)
4 stars
3 (33%)
3 stars
1 (11%)
2 stars
0 (0%)
1 star
0 (0%)
No one has reviewed this book yet.

Can't find what you're looking for?

Get help and learn more about the design.