<!--
{
  "availability" : [
    "iOS: 16.4.0 -",
    "iPadOS: 16.4.0 -",
    "macCatalyst: 16.4.0 -",
    "macOS: 13.3.0 -",
    "tvOS: 16.4.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/StaticBigInt",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s12StaticBigIntV"
  },
  "title" : "StaticBigInt"
}
-->

# StaticBigInt

An immutable arbitrary-precision signed integer.

```
@frozen struct StaticBigInt
```

## Overview

`StaticBigInt` is primarily intended to be used as the associated type of an
`ExpressibleByIntegerLiteral` conformance.

```
extension UInt256: ExpressibleByIntegerLiteral {
    public init(integerLiteral value: StaticBigInt) {
        precondition(
            value.signum() >= 0 && value.bitWidth <= 1 + Self.bitWidth,
            "integer overflow: '\(value)' as '\(Self.self)'"
        )
        self.words = Words()
        for wordIndex in 0..<Words.count {
            self.words[wordIndex] = value[wordIndex]
        }
    }
}
```

## Topics

### Instance Properties

[`var bitWidth: Int`](/documentation/Swift/StaticBigInt/bitWidth)

Returns the minimal number of bits in this value’s binary representation,
including the sign bit, and excluding the sign extension.

### Instance Methods

[`func signum() -> Int`](/documentation/Swift/StaticBigInt/signum())

Indicates the value’s sign.

### Subscripts

[`subscript(Int) -> UInt`](/documentation/Swift/StaticBigInt/subscript(_:))

Returns a 32-bit or 64-bit word of this value’s binary representation.

### Type Aliases

[`typealias IntegerLiteralType`](/documentation/Swift/StaticBigInt/IntegerLiteralType)

A type that represents an integer literal.

### Default Implementations

[CustomDebugStringConvertible Implementations](/documentation/Swift/StaticBigInt/CustomDebugStringConvertible-Implementations)

[CustomReflectable Implementations](/documentation/Swift/StaticBigInt/CustomReflectable-Implementations)

[ExpressibleByIntegerLiteral Implementations](/documentation/Swift/StaticBigInt/ExpressibleByIntegerLiteral-Implementations)

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)