0001    //
0002    //  BigUInt.swift
0003    //  BigInt
0004    //
0005    //  Created by Károly Lőrentey on 2015-12-26.
0006    //  Copyright © 2016 Károly Lőrentey. All rights reserved.
0007    //
0008    
0009    import Foundation
0010    
0011    /// An arbitary precision unsigned integer type, also known as a "big integer".
0012    ///
0013    /// Operations on big integers never overflow, but they might take a long time to execute.
0014    /// The amount of memory (and address space) available is the only constraint to the magnitude of these numbers.
0015    ///
0016    /// This particular big integer type uses base-2^64 digits to represent integers; you can think of it as a wrapper
0017    /// around `Array<UInt64>`. In fact, `BigUInt` implements a mutable collection of its `UInt64` digits, with the
0018    /// digit at index 0 being the least significant.
0019    ///
0020    /// To make memory management simple, `BigUInt` allows you to subscript it with out-of-bounds indexes:
0021    /// the subscript getter zero-extends the digit sequence, while the subscript setter automatically extends the
0022    /// underlying storage when necessary:
0023    ///
0024    /// ```Swift
0025    /// var number = BigUInt(1)
0026    /// number[42]                // Not an error, returns 0
0027    /// number[23] = 1            // Not an error, number is now 2^1472 + 1.
0028    /// ```
0029    ///
0030    /// Note that it is rarely a good idea to use big integers as collections; in the vast majority of cases it is much
0031    /// easier to work with the provided high-level methods and operators rather than with raw big digits.
0032    public struct BigUInt
BigInt.swift:33
    public var abs: BigUInt
BigInt.swift:38
    public init(abs: BigUInt, negative: Bool = false) {
BigInt.swift:45
        self.init(abs: BigUInt(integer), negative: false)
BigInt.swift:52
            self.init(abs: BigUInt(IntMax.max) + 1, negative: true)
BigInt.swift:55
            self.init(abs: BigUInt(-i), negative: true)
BigInt.swift:58
            self.init(abs: BigUInt(i), negative: false)
BigInt.swift:63
    public init(_ integer: BigUInt) {
BigInt.swift:87
        guard let abs = BigUInt(text, radix: radix) else { return nil }
BigUInt Addition.swift:11
extension BigUInt {
BigUInt Addition.swift:36
    public func addDigit(d: Digit, shift: Int = 0) -> BigUInt {
BigUInt Addition.swift:46
    public mutating func addInPlace(b: BigUInt, shift: Int = 0) {
BigUInt Addition.swift:72
    public func add(b: BigUInt, shift: Int = 0) -> BigUInt {
BigUInt Addition.swift:72
    public func add(b: BigUInt, shift: Int = 0) -> BigUInt {
BigUInt Addition.swift:93
public func +(a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Addition.swift:93
public func +(a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Addition.swift:93
public func +(a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Addition.swift:100
public func +=(inout a: BigUInt, b: BigUInt) {
BigUInt Addition.swift:100
public func +=(inout a: BigUInt, b: BigUInt) {
BigUInt Bitwise Ops.swift:12
extension BigUInt {
BigUInt Bitwise Ops.swift:54
public prefix func ~(a: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:54
public prefix func ~(a: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:55
    return BigUInt(a.map { ~$0 })
BigUInt Bitwise Ops.swift:62
public func | (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:62
public func | (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:62
public func | (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:63
    var result = BigUInt()
BigUInt Bitwise Ops.swift:74
public func & (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:74
public func & (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:74
public func & (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:75
    var result = BigUInt()
BigUInt Bitwise Ops.swift:86
public func ^ (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:86
public func ^ (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:86
public func ^ (a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Bitwise Ops.swift:87
    var result = BigUInt()
BigUInt Bitwise Ops.swift:97
public func |= (inout a: BigUInt, b: BigUInt) {
BigUInt Bitwise Ops.swift:97
public func |= (inout a: BigUInt, b: BigUInt) {
BigUInt Bitwise Ops.swift:104
public func &= (inout a: BigUInt, b: BigUInt) {
BigUInt Bitwise Ops.swift:104
public func &= (inout a: BigUInt, b: BigUInt) {
BigUInt Bitwise Ops.swift:111
public func ^= (inout a: BigUInt, b: BigUInt) {
BigUInt Bitwise Ops.swift:111
public func ^= (inout a: BigUInt, b: BigUInt) {
BigUInt Comparison.swift:11
extension BigUInt: Comparable {
BigUInt Comparison.swift:18
    public static func compare(a: BigUInt, _ b: BigUInt) -> NSComparisonResult {
BigUInt Comparison.swift:18
    public static func compare(a: BigUInt, _ b: BigUInt) -> NSComparisonResult {
BigUInt Comparison.swift:35
public func ==(a: BigUInt, b: BigUInt) -> Bool {
BigUInt Comparison.swift:35
public func ==(a: BigUInt, b: BigUInt) -> Bool {
BigUInt Comparison.swift:36
    return BigUInt.compare(a, b) == .OrderedSame
BigUInt Comparison.swift:43
public func <(a: BigUInt, b: BigUInt) -> Bool {
BigUInt Comparison.swift:43
public func <(a: BigUInt, b: BigUInt) -> Bool {
BigUInt Comparison.swift:44
    return BigUInt.compare(a, b) == .OrderedAscending
BigUInt Comparison.swift:47
extension BigUInt {
BigUInt Data.swift:11
extension BigUInt {
BigUInt Division.swift:12
extension BigUInt {
BigUInt Division.swift:41
    public func divideByDigit(y: Digit) -> (div: BigUInt, mod: Digit) {
BigUInt Division.swift:53
    public func divide(y: BigUInt) -> (div: BigUInt, mod: BigUInt) {
BigUInt Division.swift:53
    public func divide(y: BigUInt) -> (div: BigUInt, mod: BigUInt) {
BigUInt Division.swift:53
    public func divide(y: BigUInt) -> (div: BigUInt, mod: BigUInt) {
BigUInt Division.swift:67
            return (div, BigUInt(mod))
BigUInt Division.swift:131
        var quotient = BigUInt()
BigUInt Division.swift:171
public func /(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Division.swift:171
public func /(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Division.swift:171
public func /(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Division.swift:179
public func %(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Division.swift:179
public func %(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Division.swift:179
public func %(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Division.swift:186
public func /=(inout x: BigUInt, y: BigUInt) {
BigUInt Division.swift:186
public func /=(inout x: BigUInt, y: BigUInt) {
BigUInt Division.swift:193
public func %=(inout x: BigUInt, y: BigUInt) {
BigUInt Division.swift:193
public func %=(inout x: BigUInt, y: BigUInt) {
BigUInt Exponentiation.swift:11
extension BigUInt {
BigUInt Exponentiation.swift:27
    public func power(exponent: Int) -> BigUInt {
BigUInt Exponentiation.swift:31
        var result = BigUInt(1)
BigUInt Exponentiation.swift:52
    public func power(exponent: BigUInt, modulus: BigUInt) -> BigUInt {
BigUInt Exponentiation.swift:52
    public func power(exponent: BigUInt, modulus: BigUInt) -> BigUInt {
BigUInt Exponentiation.swift:52
    public func power(exponent: BigUInt, modulus: BigUInt) -> BigUInt {
BigUInt Exponentiation.swift:54
        var result = BigUInt(1)
BigUInt GCD.swift:11
extension BigUInt {
BigUInt GCD.swift:18
    public static func gcd(a: BigUInt, _ b: BigUInt) -> BigUInt {
BigUInt GCD.swift:18
    public static func gcd(a: BigUInt, _ b: BigUInt) -> BigUInt {
BigUInt GCD.swift:18
    public static func gcd(a: BigUInt, _ b: BigUInt) -> BigUInt {
BigUInt GCD.swift:20
        if a.isZero || b.isZero { return BigUInt() }
BigUInt GCD.swift:45
    public func inverse(modulus: BigUInt) -> BigUInt? {
BigUInt GCD.swift:45
    public func inverse(modulus: BigUInt) -> BigUInt? {
BigUInt Hashing.swift:11
extension BigUInt: Hashable {
BigUInt Multiplication.swift:11
extension BigUInt {
BigUInt Multiplication.swift:37
    public func multiplyByDigit(y: Digit) -> BigUInt {
BigUInt Multiplication.swift:49
    public mutating func multiplyAndAddInPlace(x: BigUInt, _ y: Digit, shift: Int = 0) {
BigUInt Multiplication.swift:84
    public func multiply(y: BigUInt) -> BigUInt {
BigUInt Multiplication.swift:84
    public func multiply(y: BigUInt) -> BigUInt {
BigUInt Multiplication.swift:101
public func *(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Multiplication.swift:101
public func *(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Multiplication.swift:101
public func *(x: BigUInt, y: BigUInt) -> BigUInt {
BigUInt Multiplication.swift:104
    if xc == 0 { return BigUInt() }
BigUInt Multiplication.swift:105
    if yc == 0 { return BigUInt() }
BigUInt Multiplication.swift:109
    if min(xc, yc) <= BigUInt.directMultiplicationLimit {
BigUInt Multiplication.swift:113
        var result = BigUInt()
BigUInt Multiplication.swift:162
public func *=(inout a: BigUInt, b: BigUInt) {
BigUInt Multiplication.swift:162
public func *=(inout a: BigUInt, b: BigUInt) {
BigUInt Prime Test.swift:14
let primes: [BigUInt.Digit] = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]
BigUInt Prime Test.swift:20
let pseudoPrimes: [BigUInt] = [
BigUInt Prime Test.swift:36
extension BigUInt {
BigUInt Prime Test.swift:43
    public func isStrongProbablePrime(base: BigUInt) -> Bool {
BigUInt Prime Test.swift:99
                guard isStrongProbablePrime(BigUInt(primes[i])) else {
BigUInt Prime Test.swift:112
            let random = BigUInt.randomIntegerLessThan(self)
BigUInt Radix Conversion.swift:12
extension BigUInt: CustomStringConvertible {
BigUInt Radix Conversion.swift:44
        let (charsPerDigit, power) = BigUInt.charsPerDigitForRadix(radix)
BigUInt Radix Conversion.swift:86
    public init(_ v: BigUInt) { self.init(v, radix: 10, uppercase: false) }
BigUInt Radix Conversion.swift:95
    public init(_ v: BigUInt, radix: Int, uppercase: Bool = false) {
BigUInt Radix Conversion.swift:97
        let (charsPerDigit, power) = BigUInt.charsPerDigitForRadix(radix)
BigUInt Radix Conversion.swift:130
extension BigUInt: CustomPlaygroundQuickLookable {
BigUInt Random.swift:11
extension BigUInt {
BigUInt Random.swift:19
    public static func randomIntegerWithMaximumWidth(width: Int) -> BigUInt {
BigUInt Random.swift:33
        return BigUInt(NSData(bytesNoCopy: buffer, length: byteCount, freeWhenDone: false))
BigUInt Random.swift:41
    public static func randomIntegerWithExactWidth(width: Int) -> BigUInt {
BigUInt Random.swift:42
        guard width > 1 else { return BigUInt(width) }
BigUInt Random.swift:53
    public static func randomIntegerLessThan(limit: BigUInt) -> BigUInt {
BigUInt Random.swift:53
    public static func randomIntegerLessThan(limit: BigUInt) -> BigUInt {
BigUInt Shifts.swift:16
public func <<= (inout b: BigUInt, amount: Int) {
BigUInt Shifts.swift:17
    typealias Digit = BigUInt.Digit
BigUInt Shifts.swift:48
public func << (b: BigUInt, amount: Int) -> BigUInt {
BigUInt Shifts.swift:48
public func << (b: BigUInt, amount: Int) -> BigUInt {
BigUInt Shifts.swift:49
    typealias Digit = BigUInt.Digit
BigUInt Shifts.swift:58
    var result = BigUInt()
BigUInt Shifts.swift:80
public func >>= (inout b: BigUInt, amount: Int) {
BigUInt Shifts.swift:81
    typealias Digit = BigUInt.Digit
BigUInt Shifts.swift:91
        b = BigUInt()
BigUInt Shifts.swift:119
public func >> (b: BigUInt, amount: Int) -> BigUInt {
BigUInt Shifts.swift:119
public func >> (b: BigUInt, amount: Int) -> BigUInt {
BigUInt Shifts.swift:120
    typealias Digit = BigUInt.Digit
BigUInt Shifts.swift:129
    if ext >= b.count { return BigUInt() }
BigUInt Shifts.swift:131
    var result = BigUInt()
BigUInt Square Root.swift:17
public func sqrt(value: BigUInt) -> BigUInt {
BigUInt Square Root.swift:17
public func sqrt(value: BigUInt) -> BigUInt {
BigUInt Square Root.swift:19
    guard !value.isZero else { return BigUInt() }
BigUInt Square Root.swift:20
    var x = BigUInt(1) << ((value.width + 1) / 2)
BigUInt Subtraction.swift:11
extension BigUInt {
BigUInt Subtraction.swift:40
    public func subtractDigitWithOverflow(d: Digit, shift: Int = 0) -> (BigUInt, overflow: Bool) {
BigUInt Subtraction.swift:62
    public func subtractDigit(d: Digit, shift: Int = 0) -> BigUInt {
BigUInt Subtraction.swift:74
    public mutating func subtractInPlaceWithOverflow(b: BigUInt, shift: Int = 0) -> Bool {
BigUInt Subtraction.swift:102
    public func subtractWithOverflow(b: BigUInt, shift: Int = 0) -> (BigUInt, overflow: Bool) {
BigUInt Subtraction.swift:102
    public func subtractWithOverflow(b: BigUInt, shift: Int = 0) -> (BigUInt, overflow: Bool) {
BigUInt Subtraction.swift:113
    public mutating func subtractInPlace(b: BigUInt, shift: Int = 0) {
BigUInt Subtraction.swift:124
    public func subtract(b: BigUInt, shift: Int = 0) -> BigUInt {
BigUInt Subtraction.swift:124
    public func subtract(b: BigUInt, shift: Int = 0) -> BigUInt {
BigUInt Subtraction.swift:146
public func -(a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Subtraction.swift:146
public func -(a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Subtraction.swift:146
public func -(a: BigUInt, b: BigUInt) -> BigUInt {
BigUInt Subtraction.swift:154
public func -=(inout a: BigUInt, b: BigUInt) {
BigUInt Subtraction.swift:154
public func -=(inout a: BigUInt, b: BigUInt) {
BigUInt.swift:74
extension BigUInt: IntegerLiteralConvertible {
BigUInt.swift:83
extension BigUInt: StringLiteralConvertible {
BigUInt.swift:89
        self = BigUInt(String(value), radix: 10)!
BigUInt.swift:95
        self = BigUInt(value, radix: 10)!
BigUInt.swift:101
        self = BigUInt(value, radix: 10)!
BigUInt.swift:105
extension BigUInt {
BigUInt.swift:129
extension BigUInt: CollectionType {
BigUInt.swift:182
            return BigUInt(digits: _digits, start: _start + range.startIndex, end: _start + range.endIndex)
BigUInt.swift:203
extension BigUInt {
BigUInt.swift:214
    internal var split: (high: BigUInt, low: BigUInt) {
BigUInt.swift:214
    internal var split: (high: BigUInt, low: BigUInt) {
BigUInt.swift:231
    internal var low: BigUInt {
BigUInt.swift:239
    internal var high: BigUInt {
{ 0033 /// The type representing a digit in `BigUInt`'s underlying number system. 0034 public typealias Digit
BigUInt Addition.swift:18
    public mutating func addDigitInPlace(d: Digit, shift: Int = 0) {
BigUInt Addition.swift:21
        var carry: Digit = d
BigUInt Addition.swift:24
            let (d, c) = Digit.addWithOverflow(self[i], carry)
BigUInt Addition.swift:36
    public func addDigit(d: Digit, shift: Int = 0) -> BigUInt {
BigUInt Addition.swift:53
            let (d, c) = Digit.addWithOverflow(self[ai], b[bi])
BigUInt Addition.swift:55
                let (d2, c2) = Digit.addWithOverflow(d, 1)
BigUInt Bitwise Ops.swift:21
        return count * Digit.width - self[count - 1].leadingZeroes
BigUInt Bitwise Ops.swift:44
        return i * Digit.width + self[i].trailingZeroes
BigUInt Data.swift:18
        precondition(Digit.width % 8 == 0)
BigUInt Data.swift:24
        let bytesPerDigit = Digit.width / 8
BigUInt Data.swift:31
        var digit: Digit = 0
BigUInt Data.swift:36
                digit += Digit(p[i])
BigUInt Data.swift:53
        precondition(Digit.width % 8 == 0)
BigUInt Data.swift:63
            for _ in 0 ..< Digit.width / 8 {
BigUInt Division.swift:20
    public mutating func divideInPlaceByDigit(y: Digit) -> Digit {
BigUInt Division.swift:20
    public mutating func divideInPlaceByDigit(y: Digit) -> Digit {
BigUInt Division.swift:25
        var remainder: Digit = 0
BigUInt Division.swift:28
            let q = Digit.fullDivide(remainder, u, y)
BigUInt Division.swift:41
    public func divideByDigit(y: Digit) -> (div: BigUInt, mod: Digit) {
BigUInt Division.swift:41
    public func divideByDigit(y: Digit) -> (div: BigUInt, mod: Digit) {
BigUInt Division.swift:93
        func approximateQuotient(x x: (Digit, Digit, Digit), y: (Digit, Digit)) -> Digit {
BigUInt Division.swift:93
        func approximateQuotient(x x: (Digit, Digit, Digit), y: (Digit, Digit)) -> Digit {
BigUInt Division.swift:93
        func approximateQuotient(x x: (Digit, Digit, Digit), y: (Digit, Digit)) -> Digit {
BigUInt Division.swift:93
        func approximateQuotient(x x: (Digit, Digit, Digit), y: (Digit, Digit)) -> Digit {
BigUInt Division.swift:93
        func approximateQuotient(x x: (Digit, Digit, Digit), y: (Digit, Digit)) -> Digit {
BigUInt Division.swift:93
        func approximateQuotient(x x: (Digit, Digit, Digit), y: (Digit, Digit)) -> Digit {
BigUInt Division.swift:95
            var q: Digit
BigUInt Division.swift:96
            var r: Digit
BigUInt Division.swift:98
                q = Digit.max
BigUInt Division.swift:99
                let (s, o) = Digit.addWithOverflow(x.0, x.1)
BigUInt Division.swift:104
                let (d, m) = Digit.fullDivide(x.0, x.1, y.0)
BigUInt Division.swift:110
            let (ph, pl) = Digit.fullMultiply(q, y.1)
BigUInt Division.swift:113
            let (r1, ro) = Digit.addWithOverflow(r, y.0)
BigUInt Division.swift:116
            let (pl1, so) = Digit.subtractWithOverflow(pl, y.1)
BigUInt Multiplication.swift:18
    public mutating func multiplyInPlaceByDigit(y: Digit) {
BigUInt Multiplication.swift:22
        var carry: Digit = 0
BigUInt Multiplication.swift:25
            let (h, l) = Digit.fullMultiply(self[i], y)
BigUInt Multiplication.swift:26
            let (low, o) = Digit.addWithOverflow(l, carry)
BigUInt Multiplication.swift:37
    public func multiplyByDigit(y: Digit) -> BigUInt {
BigUInt Multiplication.swift:49
    public mutating func multiplyAndAddInPlace(x: BigUInt, _ y: Digit, shift: Int = 0) {
BigUInt Multiplication.swift:54
        var mulCarry: Digit = 0
BigUInt Multiplication.swift:59
            let (h, l) = Digit.fullMultiply(x[xi], y)
BigUInt Multiplication.swift:60
            let (low, o) = Digit.addWithOverflow(l, mulCarry)
BigUInt Multiplication.swift:64
            let (sum1, so1) = Digit.addWithOverflow(self[ai], low)
BigUInt Multiplication.swift:66
                let (sum2, so2) = Digit.addWithOverflow(sum1, 1)
BigUInt Prime Test.swift:14
let primes: [BigUInt.Digit] = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]
BigUInt Radix Conversion.swift:20
    private static func charsPerDigitForRadix(radix: Int) -> (chars: Int, power: Digit) {
BigUInt Radix Conversion.swift:21
        var power: Digit = 1
BigUInt Radix Conversion.swift:25
            let (p, o) = Digit.multiplyWithOverflow(power, Digit(radix))
BigUInt Radix Conversion.swift:25
            let (p, o) = Digit.multiplyWithOverflow(power, Digit(radix))
BigUInt Radix Conversion.swift:46
        var digits: [Digit] = []
BigUInt Radix Conversion.swift:53
                guard let d = Digit(piece, radix: radix) else { return nil }
BigUInt Radix Conversion.swift:60
            guard let d = Digit(piece, radix: radix) else { return nil }
BigUInt Random.swift:44
        result[(width - 1) / Digit.width] |= 1 << Digit((width - 1) % Digit.width)
BigUInt Random.swift:44
        result[(width - 1) / Digit.width] |= 1 << Digit((width - 1) % Digit.width)
BigUInt Random.swift:44
        result[(width - 1) / Digit.width] |= 1 << Digit((width - 1) % Digit.width)
BigUInt Shifts.swift:17
    typealias Digit = BigUInt.Digit
BigUInt Shifts.swift:49
    typealias Digit = BigUInt.Digit
BigUInt Shifts.swift:81
    typealias Digit = BigUInt.Digit
BigUInt Shifts.swift:120
    typealias Digit = BigUInt.Digit
BigUInt Subtraction.swift:20
    public mutating func subtractDigitInPlaceWithOverflow(d: Digit, shift: Int = 0) -> Bool {
BigUInt Subtraction.swift:23
        var carry: Digit = d
BigUInt Subtraction.swift:26
            let (d, c) = Digit.subtractWithOverflow(self[i], carry)
BigUInt Subtraction.swift:40
    public func subtractDigitWithOverflow(d: Digit, shift: Int = 0) -> (BigUInt, overflow: Bool) {
BigUInt Subtraction.swift:51
    public mutating func subtractDigitInPlace(d: Digit, shift: Int = 0) {
BigUInt Subtraction.swift:62
    public func subtractDigit(d: Digit, shift: Int = 0) -> BigUInt {
BigUInt Subtraction.swift:81
            let (d, c) = Digit.subtractWithOverflow(self[ai], b[bi])
BigUInt Subtraction.swift:83
                let (d2, c2) = Digit.subtractWithOverflow(d, 1)
BigUInt.swift:36
    internal var _digits: [Digit]
BigUInt.swift:40
    internal init(digits: [Digit], start: Int, end: Int) {
BigUInt.swift:56
    public init(_ digits: [Digit]) {
BigUInt.swift:62
        self.init(Digit.digitsFromUIntMax(integer.toUIntMax()))
BigUInt.swift:140
    public func generate() -> DigitGenerator<Digit> {
= UInt64 0035 0036 internal var _digits
BigUInt Shifts.swift:38
        b._digits.insertContentsOf(Array<Digit>(count: ext, repeatedValue: 0), at: 0)
BigUInt Shifts.swift:39
        b._end = b._digits.count
BigUInt Shifts.swift:98
        b._digits.removeRange(0 ..< ext)
BigUInt Shifts.swift:99
        b._end = b._digits.count
BigUInt.swift:45
        self._digits = digits
BigUInt.swift:109
    internal var isTop: Bool { return _start == 0 && _end == _digits.count }
BigUInt.swift:114
        _digits = Array(self)
BigUInt.swift:116
        _end = _digits.count
BigUInt.swift:122
        while _digits.last == 0 {
BigUInt.swift:123
            _digits.removeLast()
BigUInt.swift:125
        _end = _digits.count
BigUInt.swift:141
        return DigitGenerator(digits: _digits, end: _end, index: _start)
BigUInt.swift:158
            return (i < min(_end, _digits.count) ? _digits[i] : 0)
BigUInt.swift:158
            return (i < min(_end, _digits.count) ? _digits[i] : 0)
BigUInt.swift:165
                _digits[i] = digit
BigUInt.swift:172
                while _digits.count < i { _digits.append(0) }
BigUInt.swift:172
                while _digits.count < i { _digits.append(0) }
BigUInt.swift:173
                _digits.append(digit)
BigUInt.swift:182
            return BigUInt(digits: _digits, start: _start + range.startIndex, end: _start + range.endIndex)
: [Digit] 0037 internal var _start
BigUInt.swift:46
        self._start = start
BigUInt.swift:109
    internal var isTop: Bool { return _start == 0 && _end == _digits.count }
BigUInt.swift:115
        _start = 0
BigUInt.swift:133
    public var count: Int { return _end - _start }
BigUInt.swift:141
        return DigitGenerator(digits: _digits, end: _end, index: _start)
BigUInt.swift:157
            let i = _start + index
BigUInt.swift:163
            let i = _start + index
BigUInt.swift:182
            return BigUInt(digits: _digits, start: _start + range.startIndex, end: _start + range.endIndex)
BigUInt.swift:182
            return BigUInt(digits: _digits, start: _start + range.startIndex, end: _start + range.endIndex)
: Int 0038 internal var _end
BigUInt Shifts.swift:39
        b._end = b._digits.count
BigUInt Shifts.swift:99
        b._end = b._digits.count
BigUInt.swift:47
        self._end = end
BigUInt.swift:109
    internal var isTop: Bool { return _start == 0 && _end == _digits.count }
BigUInt.swift:116
        _end = _digits.count
BigUInt.swift:125
        _end = _digits.count
BigUInt.swift:133
    public var count: Int { return _end - _start }
BigUInt.swift:141
        return DigitGenerator(digits: _digits, end: _end, index: _start)
BigUInt.swift:158
            return (i < min(_end, _digits.count) ? _digits[i] : 0)
BigUInt.swift:164
            if i < _end {
BigUInt.swift:166
                if digit == 0 && i == _end - 1 {
BigUInt.swift:174
                _end = i + 1
: Int 0039 0040 internal init
BigUInt.swift:57
        self.init(digits: digits, start: 0, end: digits.count)
BigUInt.swift:182
            return BigUInt(digits: _digits, start: _start + range.startIndex, end: _start + range.endIndex)
(digits: [Digit], start: Int, end: Int) { 0041 precondition(start >= 0 && start <= end) 0042 let start = min(start, digits.count) 0043 var end = min(end, digits.count) 0044 while end > start && digits[end - 1] == 0 { end -= 1 } 0045 self._digits = digits 0046 self._start = start 0047 self._end = end 0048 } 0049 0050 /// Initializes a new BigUInt with value 0. 0051 public init
BigUInt Bitwise Ops.swift:63
    var result = BigUInt()
BigUInt Bitwise Ops.swift:75
    var result = BigUInt()
BigUInt Bitwise Ops.swift:87
    var result = BigUInt()
BigUInt Data.swift:20
        self.init()
BigUInt Division.swift:131
        var quotient = BigUInt()
BigUInt GCD.swift:20
        if a.isZero || b.isZero { return BigUInt() }
BigUInt Multiplication.swift:104
    if xc == 0 { return BigUInt() }
BigUInt Multiplication.swift:105
    if yc == 0 { return BigUInt() }
BigUInt Multiplication.swift:113
        var result = BigUInt()
BigUInt Radix Conversion.swift:68
            self.init()
BigUInt Shifts.swift:58
    var result = BigUInt()
BigUInt Shifts.swift:91
        b = BigUInt()
BigUInt Shifts.swift:129
    if ext >= b.count { return BigUInt() }
BigUInt Shifts.swift:131
    var result = BigUInt()
BigUInt Square Root.swift:19
    guard !value.isZero else { return BigUInt() }
() { 0052 self.init([]) 0053 } 0054 0055 /// Initializes a new BigUInt with the specified digits. The digits are ordered from least to most significant. 0056 public init
BigUInt Bitwise Ops.swift:55
    return BigUInt(a.map { ~$0 })
BigUInt Radix Conversion.swift:65
            self.init(digits)
BigUInt.swift:52
        self.init([])
BigUInt.swift:62
        self.init(Digit.digitsFromUIntMax(integer.toUIntMax()))
(_ digits: [Digit]) { 0057 self.init(digits: digits, start: 0, end: digits.count) 0058 } 0059 0060 /// Initializes a new BigUInt that has the supplied value. 0061 public init
BigInt.swift:45
        self.init(abs: BigUInt(integer), negative: false)
BigUInt Division.swift:67
            return (div, BigUInt(mod))
BigUInt Prime Test.swift:99
                guard isStrongProbablePrime(BigUInt(primes[i])) else {
BigUInt.swift:70
        self.init(UIntMax(integer.toIntMax()))
BigUInt.swift:79
        self.init(value.toUIntMax())
<I: UnsignedIntegerType>(_ integer: I) { 0062 self.init(Digit.digitsFromUIntMax(integer.toUIntMax())) 0063 } 0064 0065 /// Initializes a new BigUInt that has the supplied value. 0066 /// 0067 /// - Requires: integer >= 0 0068 public init
BigInt.swift:52
            self.init(abs: BigUInt(IntMax.max) + 1, negative: true)
BigInt.swift:55
            self.init(abs: BigUInt(-i), negative: true)
BigInt.swift:58
            self.init(abs: BigUInt(i), negative: false)
BigUInt Exponentiation.swift:31
        var result = BigUInt(1)
BigUInt Exponentiation.swift:54
        var result = BigUInt(1)
BigUInt Random.swift:42
        guard width > 1 else { return BigUInt(width) }
BigUInt Square Root.swift:20
    var x = BigUInt(1) << ((value.width + 1) / 2)
<I: SignedIntegerType>(_ integer: I) { 0069 precondition(integer >= 0) 0070 self.init(UIntMax(integer.toIntMax())) 0071 } 0072 } 0073 0074 extension BigUInt: IntegerLiteralConvertible { 0075 //MARK: Init from Integer literals 0076 0077 /// Initialize a new big integer from an integer literal. 0078 public init(integerLiteral value: UInt64) { 0079 self.init(value.toUIntMax()) 0080 } 0081 } 0082 0083 extension BigUInt: StringLiteralConvertible { 0084 //MARK: Init from String literals 0085 0086 /// Initialize a new big integer from a Unicode scalar. 0087 /// The scalar must represent a decimal digit. 0088 public init(unicodeScalarLiteral value: UnicodeScalar) { 0089 self = BigUInt(String(value), radix: 10)! 0090 } 0091 0092 /// Initialize a new big integer from an extended grapheme cluster. 0093 /// The cluster must consist of a decimal digit. 0094 public init(extendedGraphemeClusterLiteral value: String) { 0095 self = BigUInt(value, radix: 10)! 0096 } 0097 0098 /// Initialize a new big integer from a decimal number represented by a string literal of arbitrary length. 0099 /// The string must contain only decimal digits. 0100 public init(stringLiteral value: StringLiteralType) { 0101 self = BigUInt(value, radix: 10)! 0102 } 0103 } 0104 0105 extension BigUInt { 0106 //MARK: Lift and shrink 0107 0108 /// True iff this integer is not a slice. 0109 internal var isTop
BigUInt.swift:113
        guard !isTop else { return }
BigUInt.swift:121
        assert(isTop)
: Bool { return _start == 0 && _end == _digits.count } 0110 0111 /// Ensures that this integer is not a slice, allocating a new digit array if necessary. 0112 internal mutating func lift
BigUInt Addition.swift:20
        lift()
BigUInt Addition.swift:48
        lift()
BigUInt Division.swift:23
        lift()
BigUInt Multiplication.swift:21
        lift()
BigUInt Multiplication.swift:53
        lift()
BigUInt Shifts.swift:26
    b.lift()
BigUInt Shifts.swift:95
    b.lift()
BigUInt Subtraction.swift:22
        lift()
BigUInt Subtraction.swift:76
        lift()
BigUInt.swift:162
            lift()
() { 0113 guard !isTop else { return } 0114 _digits = Array(self) 0115 _start = 0 0116 _end = _digits.count 0117 } 0118 0119 /// Gets rid of leading zero digits in the digit array. 0120 internal mutating func shrink
BigUInt Shifts.swift:110
        b.shrink()
BigUInt.swift:167
                    shrink()
() { 0121 assert(isTop) 0122 while _digits.last == 0 { 0123 _digits.removeLast() 0124 } 0125 _end = _digits.count 0126 } 0127 } 0128 0129 extension BigUInt: CollectionType { 0130 //MARK: CollectionType 0131 0132 /// The number of digits in this integer, excluding leading zero digits. 0133 public var count
BigUInt Addition.swift:51
        while bi < b.count || carry {
BigUInt Bitwise Ops.swift:20
        guard count > 0 else { return 0 }
BigUInt Bitwise Ops.swift:21
        return count * Digit.width - self[count - 1].leadingZeroes
BigUInt Bitwise Ops.swift:21
        return count * Digit.width - self[count - 1].leadingZeroes
BigUInt Bitwise Ops.swift:32
        guard count > 0 else { return 0 }
BigUInt Bitwise Ops.swift:33
        return self[count - 1].leadingZeroes
BigUInt Bitwise Ops.swift:42
        guard count > 0 else { return 0 }
BigUInt Bitwise Ops.swift:64
    for i in (0 ..< max(a.count, b.count)).reverse() {
BigUInt Bitwise Ops.swift:64
    for i in (0 ..< max(a.count, b.count)).reverse() {
BigUInt Bitwise Ops.swift:76
    for i in (0 ..< max(a.count, b.count)).reverse() {
BigUInt Bitwise Ops.swift:76
    for i in (0 ..< max(a.count, b.count)).reverse() {
BigUInt Bitwise Ops.swift:88
    for i in (0 ..< max(a.count, b.count)).reverse() {
BigUInt Bitwise Ops.swift:88
    for i in (0 ..< max(a.count, b.count)).reverse() {
BigUInt Comparison.swift:19
        if a.count != b.count { return a.count > b.count ? .OrderedDescending : .OrderedAscending }
BigUInt Comparison.swift:19
        if a.count != b.count { return a.count > b.count ? .OrderedDescending : .OrderedAscending }
BigUInt Comparison.swift:19
        if a.count != b.count { return a.count > b.count ? .OrderedDescending : .OrderedAscending }
BigUInt Comparison.swift:19
        if a.count != b.count { return a.count > b.count ? .OrderedDescending : .OrderedAscending }
BigUInt Comparison.swift:20
        for i in (0..<a.count).reverse() {
BigUInt Comparison.swift:52
        return count == 0
BigUInt Division.swift:26
        for i in (0..<count).reverse() {
BigUInt Division.swift:57
        precondition(y.count > 0)
BigUInt Division.swift:61
        if self.count < y.count {
BigUInt Division.swift:61
        if self.count < y.count {
BigUInt Division.swift:64
        if y.count == 1 {
BigUInt Division.swift:132
        assert(divisor.count == y.count && divisor.last!.high > 0)
BigUInt Division.swift:132
        assert(divisor.count == y.count && divisor.last!.high > 0)
BigUInt Division.swift:135
        let dc = divisor.count
BigUInt Division.swift:138
        for j in (dc ... remainder.count).reverse() {
BigUInt Exponentiation.swift:30
        if self.count <= 1 && self[0] <= 1 { return self }
BigUInt Hashing.swift:16
        var hash: UInt64 = UInt64(count).byteSwapped
BigUInt Hashing.swift:17
        for i in 0..<count {
BigUInt Multiplication.swift:23
        let c = self.count
BigUInt Multiplication.swift:51
        guard y != 0 && x.count > 0 else { return }
BigUInt Multiplication.swift:56
        let xc = x.count
BigUInt Multiplication.swift:102
    let xc = x.count
BigUInt Multiplication.swift:103
    let yc = y.count
BigUInt Multiplication.swift:114
        for i in (0 ..< right.count).reverse() {
BigUInt Prime Test.swift:79
        if count <= 1 && self[0] < 2 { return false }
BigUInt Prime Test.swift:80
        if count == 1 && self[0] < 4 { return true }
BigUInt Prime Test.swift:88
            if self.count == 1 && self[0] == p {
BigUInt Shifts.swift:30
        while i < b.count || lowbits > 0 {
BigUInt Shifts.swift:37
    if ext > 0 && b.count > 0 {
BigUInt Shifts.swift:62
        while i < b.count || lowbits > 0 {
BigUInt Shifts.swift:70
        for i in 0..<b.count {
BigUInt Shifts.swift:90
    if ext >= b.count {
BigUInt Shifts.swift:102
        var i = b.count - 1
BigUInt Shifts.swift:129
    if ext >= b.count { return BigUInt() }
BigUInt Shifts.swift:134
        for i in (ext..<b.count).reverse() {
BigUInt Shifts.swift:141
        for i in (ext..<b.count).reverse() {
BigUInt Subtraction.swift:25
        while carry > 0 && i < count {
BigUInt Subtraction.swift:79
        while bi < b.count || (shift + bi < count && carry) {
BigUInt Subtraction.swift:79
        while bi < b.count || (shift + bi < count && carry) {
BigUInt.swift:137
    public var endIndex: Int { return count }
BigUInt.swift:215
        precondition(count > 1)
BigUInt.swift:217
        return (self[mid ..< count], self[0 ..< mid])
BigUInt.swift:224
        return (count + 1) / 2
BigUInt.swift:240
        return self[middleIndex ..< count]
: Int { return _end - _start } 0134 /// The index of the first digit, starting from the least significant. (This is always zero.) 0135 public var startIndex: Int { return 0 } 0136 /// The index of the digit after the most significant digit in this integer. 0137 public var endIndex: Int { return count } 0138 0139 /// Return a generator over the digits of this integer, starting at the least significant digit. 0140 public func generate() -> DigitGenerator<Digit> { 0141 return DigitGenerator(digits: _digits, end: _end, index: _start) 0142 } 0143 0144 /// Get or set a digit at a given position. 0145 /// 0146 /// - Note: Unlike a normal collection, it is OK for the index to be greater than or equal to `count`. 0147 /// The subscripting getter returns zero for indexes beyond the most significant digit. 0148 /// Setting these digits automatically appends new elements to the underlying digit array. 0149 /// - Requires: index >= 0 0150 /// - Complexity: The getter is O(1). The setter is O(1) if the conditions below are true; otherwise it's O(count). 0151 /// - The integer's storage is not shared with another integer 0152 /// - The integer wasn't created as a slice of another integer 0153 /// - `index < count` 0154 public subscript
BigUInt Addition.swift:24
            let (d, c) = Digit.addWithOverflow(self[i], carry)
BigUInt Addition.swift:25
            self[i] = d
BigUInt Addition.swift:53
            let (d, c) = Digit.addWithOverflow(self[ai], b[bi])
BigUInt Addition.swift:53
            let (d, c) = Digit.addWithOverflow(self[ai], b[bi])
BigUInt Addition.swift:56
                self[ai] = d2
BigUInt Addition.swift:60
                self[ai] = d
BigUInt Bitwise Ops.swift:21
        return count * Digit.width - self[count - 1].leadingZeroes
BigUInt Bitwise Ops.swift:33
        return self[count - 1].leadingZeroes
BigUInt Bitwise Ops.swift:44
        return i * Digit.width + self[i].trailingZeroes
BigUInt Bitwise Ops.swift:65
        result[i] = a[i] | b[i]
BigUInt Bitwise Ops.swift:65
        result[i] = a[i] | b[i]
BigUInt Bitwise Ops.swift:65
        result[i] = a[i] | b[i]
BigUInt Bitwise Ops.swift:77
        result[i] = a[i] & b[i]
BigUInt Bitwise Ops.swift:77
        result[i] = a[i] & b[i]
BigUInt Bitwise Ops.swift:77
        result[i] = a[i] & b[i]
BigUInt Bitwise Ops.swift:89
        result[i] = a[i] ^ b[i]
BigUInt Bitwise Ops.swift:89
        result[i] = a[i] ^ b[i]
BigUInt Bitwise Ops.swift:89
        result[i] = a[i] ^ b[i]
BigUInt Comparison.swift:21
            let ad = a[i]
BigUInt Comparison.swift:22
            let bd = b[i]
BigUInt Data.swift:39
                    self[index] = digit
BigUInt Division.swift:27
            let u = self[i]
BigUInt Division.swift:29
            self[i] = q.div
BigUInt Division.swift:66
            let (div, mod) = divideByDigit(y[0])
BigUInt Division.swift:136
        let d1 = divisor[dc - 1]
BigUInt Division.swift:137
        let d0 = divisor[dc - 2]
BigUInt Division.swift:140
            let r2 = remainder[j]
BigUInt Division.swift:141
            let r1 = remainder[j - 1]
BigUInt Division.swift:142
            let r0 = remainder[j - 2]
BigUInt Division.swift:152
                quotient[j - dc] = q
BigUInt Division.swift:157
                quotient[j - dc] = q - 1
BigUInt Exponentiation.swift:30
        if self.count <= 1 && self[0] <= 1 { return self }
BigUInt Exponentiation.swift:58
            if e[0] & 1 == 1 {
BigUInt Hashing.swift:20
            hash = rotated ^ UInt64(UInt(truncatingBitPattern: Int64(self[i].hashValue &+ i)))
BigUInt Multiplication.swift:25
            let (h, l) = Digit.fullMultiply(self[i], y)
BigUInt Multiplication.swift:27
            self[i] = low
BigUInt Multiplication.swift:30
        self[c] = carry
BigUInt Multiplication.swift:59
            let (h, l) = Digit.fullMultiply(x[xi], y)
BigUInt Multiplication.swift:64
            let (sum1, so1) = Digit.addWithOverflow(self[ai], low)
BigUInt Multiplication.swift:67
                self[ai] = sum2
BigUInt Multiplication.swift:71
                self[ai] = sum1
BigUInt Multiplication.swift:106
    if yc == 1 { return x.multiplyByDigit(y[0]) }
BigUInt Multiplication.swift:107
    if xc == 1 { return y.multiplyByDigit(x[0]) }
BigUInt Multiplication.swift:115
            result.multiplyAndAddInPlace(left, right[i], shift: i)
BigUInt Prime Test.swift:79
        if count <= 1 && self[0] < 2 { return false }
BigUInt Prime Test.swift:80
        if count == 1 && self[0] < 4 { return true }
BigUInt Prime Test.swift:83
        if self[0] & 1 == 0 { return false }
BigUInt Prime Test.swift:88
            if self.count == 1 && self[0] == p {
BigUInt Random.swift:44
        result[(width - 1) / Digit.width] |= 1 << Digit((width - 1) % Digit.width)
BigUInt Shifts.swift:31
            let digit = b[i]
BigUInt Shifts.swift:32
            b[i] = digit << up | lowbits
BigUInt Shifts.swift:63
            let digit = b[i]
BigUInt Shifts.swift:64
            result[i + ext] = digit << up | lowbits
BigUInt Shifts.swift:71
            result[i + ext] = b[i]
BigUInt Shifts.swift:71
            result[i + ext] = b[i]
BigUInt Shifts.swift:105
            let digit = b[i]
BigUInt Shifts.swift:106
            b[i] = highbits | digit >> down
BigUInt Shifts.swift:135
            let digit = b[i]
BigUInt Shifts.swift:136
            result[i - ext] = highbits | digit >> down
BigUInt Shifts.swift:142
            result[i - ext] = b[i]
BigUInt Shifts.swift:142
            result[i - ext] = b[i]
BigUInt Subtraction.swift:26
            let (d, c) = Digit.subtractWithOverflow(self[i], carry)
BigUInt Subtraction.swift:27
            self[i] = d
BigUInt Subtraction.swift:81
            let (d, c) = Digit.subtractWithOverflow(self[ai], b[bi])
BigUInt Subtraction.swift:81
            let (d, c) = Digit.subtractWithOverflow(self[ai], b[bi])
BigUInt Subtraction.swift:84
                self[ai] = d2
BigUInt Subtraction.swift:88
                self[ai] = d
(index: Int) -> Digit { 0155 get { 0156 precondition(index >= 0) 0157 let i = _start + index 0158 return (i < min(_end, _digits.count) ? _digits[i] : 0) 0159 } 0160 set(digit) { 0161 precondition(index >= 0) 0162 lift() 0163 let i = _start + index 0164 if i < _end { 0165 _digits[i] = digit 0166 if digit == 0 && i == _end - 1 { 0167 shrink() 0168 } 0169 } 0170 else { 0171 guard digit != 0 else { return } 0172 while _digits.count < i { _digits.append(0) } 0173 _digits.append(digit) 0174 _end = i + 1 0175 } 0176 } 0177 } 0178 0179 /// Returns an integer built from the digits of this integer in the given range. 0180 public subscript
BigUInt Division.swift:150
            if product <= remainder[j - dc ... j] {
BigUInt.swift:217
        return (self[mid ..< count], self[0 ..< mid])
BigUInt.swift:217
        return (self[mid ..< count], self[0 ..< mid])
BigUInt.swift:232
        return self[0 ..< middleIndex]
BigUInt.swift:240
        return self[middleIndex ..< count]
(range: Range<Int>) -> BigUInt { 0181 get { 0182 return BigUInt(digits: _digits, start: _start + range.startIndex, end: _start + range.endIndex) 0183 } 0184 } 0185 } 0186 0187 /// The digit generator for a big integer. 0188 public struct DigitGenerator
BigUInt.swift:140
    public func generate() -> DigitGenerator<Digit> {
BigUInt.swift:141
        return DigitGenerator(digits: _digits, end: _end, index: _start)
<Digit
BigUInt.swift:189
    internal let digits: [Digit]
BigUInt.swift:195
    public mutating func next() -> Digit? {
>: GeneratorType { 0189 internal let digits
BigUInt.swift:197
        let v = digits[index]
: [Digit] 0190 internal let end
BigUInt.swift:196
        guard index < end else { return nil }
: Int 0191 internal var index
BigUInt.swift:196
        guard index < end else { return nil }
BigUInt.swift:197
        let v = digits[index]
BigUInt.swift:198
        index += 1
: Int 0192 0193 /// Return the next digit in the integer, or nil if there are no more digits. 0194 /// Returned digits range from least to most significant. 0195 public mutating func next() -> Digit? { 0196 guard index < end else { return nil } 0197 let v = digits[index] 0198 index += 1 0199 return v 0200 } 0201 } 0202 0203 extension BigUInt { 0204 //MARK: Low and High 0205 0206 /// Split this integer into a high-order and a low-order part. 0207 /// 0208 /// - Requires: count > 1 0209 /// - Returns: `(low, high)` such that 0210 /// - `self == low.add(high, shift: middleIndex)` 0211 /// - `high.width <= floor(width / 2)` 0212 /// - `low.width <= ceil(width / 2)` 0213 /// - Complexity: Typically O(1), but O(count) in the worst case, because high-order zero digits need to be removed after the split. 0214 internal var split
BigUInt Multiplication.swift:121
        let (xh, xl) = x.split
BigUInt Multiplication.swift:127
        let (yh, yl) = y.split
BigUInt Multiplication.swift:137
    let (a, b) = x.split
BigUInt Multiplication.swift:138
    let (c, d) = y.split
: (high: BigUInt, low: BigUInt) { 0215 precondition(count > 1) 0216 let mid = middleIndex 0217 return (self[mid ..< count], self[0 ..< mid]) 0218 } 0219 0220 /// Index of the digit at the middle of this integer. 0221 /// 0222 /// - Returns: The index of the digit that is least significant in `self.high`. 0223 internal var middleIndex
BigUInt Multiplication.swift:123
        r.addInPlace(xh * y, shift: x.middleIndex)
BigUInt Multiplication.swift:129
        r.addInPlace(yh * x, shift: y.middleIndex)
BigUInt Multiplication.swift:133
    let shift = x.middleIndex
BigUInt.swift:216
        let mid = middleIndex
BigUInt.swift:232
        return self[0 ..< middleIndex]
BigUInt.swift:240
        return self[middleIndex ..< count]
: Int { 0224 return (count + 1) / 2 0225 } 0226 0227 /// The low-order half of this BigUInt. 0228 /// 0229 /// - Returns: `self[0 ..< middleIndex]` 0230 /// - Requires: count > 1 0231 internal var low: BigUInt { 0232 return self[0 ..< middleIndex] 0233 } 0234 0235 /// The high-order half of this BigUInt. 0236 /// 0237 /// - Returns: `self[middleIndex ..< count]` 0238 /// - Requires: count > 1 0239 internal var high: BigUInt { 0240 return self[middleIndex ..< count] 0241 } 0242 } 0243 0244