Model data with numbers, Boolean values, and other fundamental types.
Numbers and Basic Values
Topics
Logical Values
struct BoolA value type whose instances are either true or false.
Numeric Values
struct IntA signed integer value type.
struct DoubleA double-precision, floating-point value type.
struct FloatA single-precision, floating-point value type.
Ranges
struct RangeA half-open interval from a lower bound up to, but not including, an upper bound.
struct ClosedRange An interval from a lower bound up to, and including, an upper bound.
Errors
protocol ErrorA type representing an error value that can be thrown.
enum ResultA value that represents either a success or a failure, including an associated value in each case.
Optionals
enum OptionalA type that represents either a wrapped value or nil, the absence of a value.
Advanced Numerics
Write generic code that works with any numeric type.
Work with fixed-width numeric types of different sizes.
Work with fixed-width vectors of fixed-width numeric types of different sizes.
Use these functions with numeric values and other comparable types.
Random Number Generators
struct SystemRandomNumberGenerator The system’s default source of random data.
protocol RandomNumberGenerator A type that provides uniformly distributed random data.
See Also
Values and Collections
Work with text using Unicode-safe strings.
Store and organize data using arrays, dictionaries, sets, and other data structures.