Contents

StaticBigInt

An immutable arbitrary-precision signed integer.

Declaration

@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

Instance Methods

Subscripts

Type Aliases

Default Implementations

See Also

Value Literals