What are swift’s floating point data types?
Asked on 07/30/2024
1 search
Swift provides several floating point data types, which are value types. These include:
Float
: A single-precision, 32-bit floating point number.Double
: A double-precision, 64-bit floating point number.
These types are part of Swift's fundamental data structures and are used to represent decimal numbers with varying degrees of precision.
For more details on Swift's value types, you can refer to the session A Swift Tour: Explore Swift’s features and design.
Relevant Sessions

Platforms State of the Union
Discover the newest advancements on Apple platforms.

What’s new in SwiftData
SwiftData makes it easy to add persistence to your app with its expressive, declarative API. Learn about refinements to SwiftData, including compound uniqueness constraints, faster queries with #Index, queries in Xcode previews, and rich predicate expressions. Join us to explore how you can use all of these features to express richer models and improve performance in your app. To discover how to build a custom data store or use the history API in SwiftData, watch “Create a custom data store with SwiftData” and “Track model changes with SwiftData history”.

Explore Swift performance
Discover how Swift balances abstraction and performance. Learn what elements of performance to consider and how the Swift optimizer affects them. Explore the different features of Swift and how they’re implemented to further understand the tradeoffs available that can impact performance.