     return r
 }
 
+/// Multiply `a` by `b` and store the result in `a`.
 public func *=(inout a: BigUInt, b: BigUInt) {
     a = a * b
 }
 
 //MARK: Bitwise Shifts
 
+/// Shift a big integer to the right by `amount` bits and store the result in place.
+/// - Complexity: O(count)
 public func <<= (inout b: BigUInt, amount: Int) {
     typealias Digit = BigUInt.Digit
 

extension BigUInt {
    /// The minimum number of bits required to represent this integer in binary.
    /// - Returns: floor(log2(2 * self + 1))
    public var width: Int {
        guard count > 0 else { return 0 }
        return count * Digit.width - self[count - 1].leadingZeroes

import Foundation

public struct BigUInt {
    /// The type representing a digit in `BigUInt`'s underlying number system.
    public typealias Digit = UInt64
    
    internal var _digits: [Digit]
