<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/numbers-and-basic-values",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Numbers and Basic Values"
}
-->

# Numbers and Basic Values

Model data with numbers, Boolean values, and other fundamental types.

## Topics

### Logical Values

[`Bool`](/documentation/Swift/Bool)

A value type whose instances are either `true` or `false`.

### Numeric Values

[`Int`](/documentation/Swift/Int)

A signed integer value type.

[`Double`](/documentation/Swift/Double)

A double-precision (64-bit), floating-point value type.

[`Float`](/documentation/Swift/Float)

A single-precision (32-bit), floating-point value type.

### Ranges

[`Range`](/documentation/Swift/Range)

A half-open interval from a lower bound up to, but not including, an upper
bound.

[`ClosedRange`](/documentation/Swift/ClosedRange)

An interval from a lower bound up to, and including, an upper bound.

### Errors

[`Error`](/documentation/Swift/Error)

A type representing an error value that can be thrown.

[`Result`](/documentation/Swift/Result)

A value that represents either a success or a failure, including an
associated value in each case.

### Optionals

[`Optional`](/documentation/Swift/Optional)

A type that represents either a wrapped value or the absence of a value.

### Advanced Numerics

  <doc://com.apple.Swift/documentation/Swift/numeric-protocols>

  <doc://com.apple.Swift/documentation/Swift/special-use-numeric-types>

  <doc://com.apple.Swift/documentation/Swift/simd-vector-types>

  <doc://com.apple.Swift/documentation/Swift/global-numeric-functions>

### Random Number Generators

[`SystemRandomNumberGenerator`](/documentation/Swift/SystemRandomNumberGenerator)

The system’s default source of random data.

[`RandomNumberGenerator`](/documentation/Swift/RandomNumberGenerator)

A type that provides uniformly distributed random data.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)