         self.measure {
             fact = BigUInt(1)
             for i in 1...n {
-                fact.multiplyInPlaceByDigit(Digit(i))
+                fact.multiply(byDigit: Digit(i))
             }
         }
         checkFactorial(fact: fact, n: n)

    }

    func testSquareRoot() {
        var numbers: [BigUInt] = (1...1000).map { _ in BigUInt.randomIntegerWithMaximumWidth(60 * sizeof(Digit) * 8) }
        var roots: [BigUInt] = []
        self.measure {
            roots.removeAll()

    func checkFactorial(fact: BigUInt, n: Int, file: StaticString = #file, line: UInt = #line) {
        var remaining = fact
        for i in 1...n {
            let (div, mod) = remaining.divided(by: BigUInt(i))
            XCTAssertEqual(mod, 0, "for divisor = \(i)", file: file, line: line)
            remaining = div
        }
