Your Int and Double Can Break the Bank (Literally) | The Decimal Type in Swift
The Code Bird
0:00 / 0:00
Your Int and Double Can Break the Bank (Literally) | The Decimal Type in Swift
933 просмотра · 3 года назад
The Code Bird
4,02 тыс. подписчиков
933 просмотра · 3 года назад
This week, I explore the Decimal type shipped in the Foundation framework: why it exists, how it’s different from Swift’s Double or Float, and when it’s appropriate to use each of them.
Support the Swift Bird by…
• …joining as a member: / @thecodebird
• …becoming a patron: https://url.ykvm.com/patreon
• …buying me a coffee: https://url.ykvm.com/bmac
Links:
• Decimal documentation: https://developer.apple.com/documenta...
• NSDecimalNumber documentation: https://developer.apple.com/documenta...
• Decimal’s source: https://github.com/apple/swift-coreli...
• When should you use Decimal instead of Double: https://www.jessesquires.com/blog/202...
Chapters:
• 0:00 Intro
• 1:48 What’s the Problem?
• 3:35 How Is Decimal Different?
• 6:23 How Does It Work Internally?
• 8:04 Any Better Alternatives?
• 9:22 Recap
• 10:18 Outro
The Swift Bird, a Yakov Manshin production 🎞️
#Decimal #Swift #softwaredevelopment