Flight School

Now Available for Free

Flight School
Guide to Swift Numbers

Everything you need to know about working with numbers in Swift

This guide starts with a comprehensive look 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.

  • Navigate Swift 5 numeric protocols.

  • Understand how integers and floating-point numbers are represented in binary.

  • Work with money using the Decimal type and creating a Currency type

  • Performing dimensional analysis and physical calculations using Foundation units & measurements

  • Format numbers in a locale-appropriate way for a global audience

  • Perform dimensional analysis and physical calculations

About the Author

Mattt is a developer and writer in Portland, Oregon. He worked 3 years at Apple as a technical writer, contributing to The Swift Programming Language, Swift Package Manager, and Swift.org.

Before that, Mattt founded NSHipster, a weekly publication for iOS and macOS developers, and maintained several open source libraries, including Alamofire and AFNetworking.

About Flight School

Founded in 2018, Flight School is an independently-published book series for advanced Swift developers interested in taking their skills to the next level.

Our mission is to write the kinds of programming books we wish we had when we were first starting out — material that connects the computer science theory with practical insights from experience working in the software industry.

…all of that, plus a sprinkle of code samples and trivia from the world of aviation. It’s an unconventional combination, but we think you’re gonna love it. 💙