StructureSwift5.9.0
StaticBigInt
An immutable arbitrary-precision signed integer.
- iOS
- 16.4+
- macOS
- 13.3+
- tvOS
- 16.4+
- watchOS
- 9.4+
@frozen struct StaticBigInt
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]
}
}
}
Citizens in Swift
Conformances
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomReflectable
A type that explicitly supplies its own mirror.
protocol ExpressibleByIntegerLiteral
A type that can be initialized with an integer literal.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Members
var bitWidth: Int
Returns the minimal number of bits in this value’s binary representation, including the sign bit, and excluding the sign extension.
var customMirror: Mirror
var debugDescription: String
subscript(Int
) -> UInt Returns a 32-bit or 64-bit word of this value’s binary representation.
func signum(
) -> Int Indicates the value’s sign.