Speaker Deck

Exploring Swift’s numeric types and protocols

by Jesse Squires

Published October 20, 2017 in Programming

Swift is a memory-safe language and you constantly see this manifest in your code with the error 'Binary operator cannot be applied to operands of type…' when you attempt to mix numeric types in expressions. In this talk we’ll explore the design and implementation of Swift’s numeric protocols and types, which have evolved significantly in Swift 3 and 4. We’ll dive into how floating-point numbers work, investigate some of the more obscure APIs, and learn how we can make our raw calculation code more expressive.

Video:
https://www.youtube.com/watch?v=cdRn4DJq9eY

Swift playground:
https://github.com/jessesquires/talks/tree/master/2017/10-19%20Exploring%20Swift's%20numeric%20protocols/NumericSwift.playground

Event:
http://iosconf.sg