Skip to content
bigearsenal edited this page May 17, 2022 · 1 revision

Int2X

public struct Int2X<Word:UInt1X>: Hashable, Codable 

Inheritance

BinaryInteger, Codable, Comparable, CustomDebugStringConvertible, CustomStringConvertible, ExpressibleByIntegerLiteral, ExpressibleByStringLiteral, FixedWidthInteger, Hashable, Numeric, Strideable

Nested Type Aliases

IntegerLiteralType

public typealias IntegerLiteralType = UInt64

Magnitude

public typealias Magnitude = UInt2X<Word>

Words

public typealias Words = [Word.Words.Element]

Stride

public typealias Stride = Int

Initializers

init(rawValue:)

public init(rawValue:Magnitude)

init(_:)

public init(_ source:Int2X) 

init()

public init() 

init?(exactly:)

public init?<T>(exactly source: T) where T : BinaryInteger 

init(_:)

public init<T>(_ source: T) where T : BinaryInteger 

init?(exactly:)

public init?<T>(exactly source: T) where T : BinaryFloatingPoint 

init(_:)

public init<T>(_ source: T) where T : BinaryFloatingPoint 

init(truncatingIfNeeded:)

public init<T:BinaryInteger>(truncatingIfNeeded source: T) 

init(clamping:)

public init<T:BinaryInteger>(clamping source: T) 

init(integerLiteral:)

public init(integerLiteral value: IntegerLiteralType) 

init(stringLiteral:)

public init(stringLiteral value: StringLiteralType) 

init(_truncatingBits:)

public init(_truncatingBits bits: UInt) 

Properties

rawValue

public var rawValue:Magnitude = 0

isSigned

public static var isSigned: Bool 

bitWidth

public static var bitWidth: Int 

max

public static var max:Int2X 

min

public static var min:Int2X 

magnitude

public var magnitude:Magnitude 

description

public var description:String 

debugDescription

public var debugDescription:String 

bitWidth

public var bitWidth: Int 

words

public var words: Words 

trailingZeroBitCount

public var trailingZeroBitCount: Int 

nonzeroBitCount

public var nonzeroBitCount: Int 

leadingZeroBitCount

public var leadingZeroBitCount: Int 

byteSwapped

public var byteSwapped: Int2X 

Methods

addingReportingOverflow(_:)

public func addingReportingOverflow(_ other: Int2X) -> (partialValue: Int2X, overflow: Bool) 

subtractingReportingOverflow(_:)

public func subtractingReportingOverflow(_ other: Int2X) -> (partialValue: Int2X, overflow: Bool) 

multipliedFullWidth(by:)

public func multipliedFullWidth(by other: Int2X) -> (high: Int2X, low: Magnitude) 

multipliedReportingOverflow(by:)

public func multipliedReportingOverflow(by other: Int2X) -> (partialValue: Int2X, overflow: Bool) 

quotientAndRemainder(dividingBy:)

public func quotientAndRemainder(dividingBy other: Int2X) -> (quotient: Int2X, remainder: Int2X) 

dividedReportingOverflow(by:)

public func dividedReportingOverflow(by other :Int2X) -> (partialValue: Int2X, overflow:Bool) 

remainderReportingOverflow(dividingBy:)

public func remainderReportingOverflow(dividingBy other :Int2X) -> (partialValue: Int2X, overflow:Bool) 

dividingFullWidth(_:)

public func dividingFullWidth(_ dividend: (high: Int2X, low: Magnitude)) -> (quotient: Int2X, remainder: Int2X) 

toString(radix:uppercase:)

public func toString(radix:Int=10, uppercase:Bool=false) -> String 

distance(to:)

public func distance(to other: Int2X) -> Int 

advanced(by:)

public func advanced(by n: Int) -> Int2X 

Operators

==

public static func == (_ lhs: Int2X, _ rhs: Int2X)->Bool 

<

public static func < (lhs: Int2X, rhs: Int2X) -> Bool 

~

public static prefix func ~(_ value:Int2X)->Int2X 

+

public static prefix func +(_ value:Int2X)->Int2X 

-

public static prefix func -(_ value:Int2X)->Int2X 

&+

public static func &+(_ lhs:Int2X, _ rhs:Int2X)->Int2X 

+

public static func +(_ lhs:Int2X, _ rhs:Int2X)->Int2X 

+=

public static func += (lhs: inout Int2X, rhs: Int2X) 

&-

public static func &-(_ lhs:Int2X, _ rhs:Int2X)->Int2X 

-

public static func -(_ lhs:Int2X, _ rhs:Int2X)->Int2X 

-=

public static func -= (lhs: inout Int2X, rhs: Int2X) 

&*

public static func &*(lhs: Int2X, rhs: Int2X) -> Int2X 

*

public static func *(lhs: Int2X, rhs: Int2X) -> Int2X 

*=

public static func *= (lhs: inout Int2X, rhs: Int2X) 

&>>

public static func &>>(_ lhs:Int2X, _ rhs:Int2X)->Int2X 

&<<

public static func &<<(_ lhs:Int2X, _ rhs:Int2X)->Int2X 

&>>=

public static func &>>=(_ lhs:inout Int2X, _ rhs:Int2X) 

&<<=

public static func &<<=(_ lhs:inout Int2X, _ rhs:Int2X) 

/

public static func / (_ lhs:Int2X, rhs:Int2X)->Int2X 

/=

public static func /= (_ lhs:inout Int2X, rhs:Int2X) 

%

public static func % (_ lhs:Int2X, rhs:Int2X)->Int2X 

%=

public static func %= (_ lhs:inout Int2X, rhs:Int2X) 

&=

public static func &= (lhs: inout Int2X, rhs: Int2X) 

|=

public static func |= (lhs: inout Int2X, rhs: Int2X) 

^=

public static func ^= (lhs: inout Int2X, rhs: Int2X) 

<<=

public static func <<= <RHS>(lhs: inout Int2X, rhs: RHS) where RHS : BinaryInteger 

>>=

public static func >>= <RHS>(lhs: inout Int2X, rhs: RHS) where RHS : BinaryInteger 
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Operators
Extensions
Clone this wiki locally